Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#193 2011-12-12 13:25:56

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: smd_tags: unlimited article, image, file and link taxonomy

no one having an idea? :-(

Offline

#194 2011-12-15 12:04:40

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: smd_tags: unlimited article, image, file and link taxonomy

hello stef,

i’m sorry that i have to post again, but somehow i seem to miss the whole point with smd_tag_list. it may be due to the fact that i’m new to textpattern or my english isn’t just good enough to understand the docs.

however, this is the issue: after updating to the most recent version, smd_tag_list just outputs nothing on the front page.

<div class=menu"><txp:smd_tag_list type="article"><txp:smd_tag_name link="1" /><txp:smd_tag_count /></txp:smd_tag_list></div>

leads to no output at all. if in individual article context the tag behaves as expected – but not on front page.

the docs say Display a list of tags matching certain criteria, from the current context (global, article, file, link, or image)

where am i going wrong? is there no global context on front page? does it need an article tag on the site instead of article_custom? i don’t get it.

would greatly appreciate if i could receive help again.

thanks, christoph

Offline

#195 2011-12-15 15:08:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

totoff wrote:

is there no global context on front page?

Not explicitly, no. As you have no doubt found out by now, Txp’s front page (or any section landing page ilke site.com/some_section) defaults to a “list view” of articles in that section. There are several built-in ‘views’ like this: one of them is site.com/category/some_category_name; another is site.com/author/some_author_real_name.

When it comes to tags, there’s no such thing, so you need to tell the plugin what to do. So, firstly, check your smd_tags preferences. The last few prefs on that page are to do with URL management. You can usually leave the URL name and type values alone but you probably need to change the ‘trigger’ list.

In its simplest case — which is the default — it looks for a section called smd_tags. If you go ahead and create this section, then assign a page +css to it as normal and put your smd_tag_list code on that page template then if you visit site.com/smd_tags/some_tag your smd_tag_list will read the ‘tag’ context from the URL, i.e. it knows it’s an article tag, and its name is some_tag. Once you’re iniside your smd_tag_list container and it knows the context you can do what you like with it: print it, use <txp:smd_related_tags> to look up other articles with the same tag, etc.

You can do similar things with the other tag types if you add the type to the URL: site.com/smd_tags/image/some_img_tag. Your smd_tag_list then gets image tag context. That’s why <txp:smd_if_tag> exists: you can either get it to check ‘is there any tag context at all here’, or ask it to only trigger contained content if it matches a certain type of tag (article, image, file, etc).

All this is fine if you are processing tag lists in a dedicated section with its own Page template, but if you are sharing a page template with another section or have elected to route your tag lists to a section that would normally contain articles (e.g. one of your triggers was set to about and you had a section of the same name) you need to figure out if the URL is a tag list or not. That’s what <txp:smd_if_tag_list> is for: it fires if the URL looks a bit like a tag list, e.g. site.com/about/article/some_tag.

Development work on this part is still ongoing as the URL coiuld clash with your URL scheme and trigger a 404 instead of what you expect. Plus there’s a small issue that it’s adding URL params to all URLs even if they don’t match you trigger. I’ve tracked down the problem in the next version but haven’t found a fix for it yet. But the good news is that I’ve slashed the query count massively so the plugin is waaaay more efficient. And not before time!

It’s complicated, but does that make some kind of sense?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#196 2011-12-15 20:25:38

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: smd_tags: unlimited article, image, file and link taxonomy

It’s complicated, but does that make some kind of sense?

yes, it does. but first of all thanks for this comprehensive answer. appreciate that you take so much time for individual support besides developing this stuff! that’s of enormous help.

in short, what i learn from your explanation is, that smd_tag_list needs the section named in the preferences under “trigger(s) for tag lists” to work properly. in my case this section is named “tag_landing” and indeed it is the section on which i got the tag working.

unfortunately this doesn’t solve my problem. all i originally wanted was more categories to build a top level category navigation from which works on every section. i used category_list and it worked fine, but was limited to the two categories that are part of the core.

i’ll now go back to the core functionality for the moment. that’s fine for me because i work on my private fotoblog in order to get better grips on txp for client work.

but, although it tends to be off topic, please allow me to ask why the core is limited to two categories? i assume this to be a drawback for potential clients if they start to compare txp offering with for example wp. ist it to keep the core fast and leightweight?

again, thanks pretty much for your help!

Offline

#197 2011-12-16 15:54:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

totoff wrote:

all i originally wanted was more categories to build a top level category navigation from which works on every section.

You can probably do this, but I don’t have time right now to propose a solution. Leave it with me and I’ll see if I can cook something up for you.

why the core is limited to two categories?

Legacy. Changing it breaks too much stuff in the 4.x branch. It’ll change one day.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#198 2011-12-31 09:21:49

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: smd_tags: unlimited article, image, file and link taxonomy

Hi:

I’m using this code in my /smd_tags/article/my-tag page and works great:

<txp:smd_tag_list>
...
<txp:smd_related_tags section="directory" form="my-list-form" wraptag="ul" />
...
</txp:smd_tag_list>

But I don’t know if it is posible to filter the query by maching a custom_field value.

I would like, in case there is a param pased by URL, like /smd_tags/article/my-tag?param=foo, list only articles that match custom_field “my-custom” value=“foo”.

I am playing with the “match” option of smd_tag_list but don’t find a way.

Perhaps it would be possible to do with smd_query instead of using smd_related_tags? (the SQL sintax is a deep mistery to my, I’m not a programmer)

Last edited by milosevic (2011-12-31 09:22:56)


<txp:rocks/>

Offline

#199 2012-01-15 19:50:01

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: smd_tags: unlimited article, image, file and link taxonomy

Hello. I have an error with smd_tags instalation:

Can’t see the smd_tag selector (any kind of it) at the Write tab. Then I use rss unlimited categories and later import from smd_tags Extension tab.

When I save a new article, I receibe this message at the bottom of the page:

“Warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘)’ at line 1 select tag_id from smd_tags_cat where cat_id IN () in /home/mi-site-name/mi-site-name.com/textpattern/lib/txplib_db.php on line 89”

The diagnosis tab sais th hosting is working with MySQL: 5.1.39-log

Any idea?


<txp:rocks/>

Offline

#200 2012-01-23 09:24:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

milosevic wrote:

Can’t see the smd_tag selector (any kind of it) at the Write tab

Hmmm, sorry for not replying sooner. The error seems to be related to categories. My guess is that you have set the Link tags to categories preference on and/or have no regular Txp article categories defined. In v0.40 you need at least one category defined (it’s a bug).

Are you using 0.40 or 0.41 beta? I fixed this issue in the beta so if you’re not using it I suggest you try it out as it also massively reduces the plugin’s impact on your database and page load time.

If it’s not that, then I’m not sure what it could be without a bit more info.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#201 2012-01-23 11:32:42

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: smd_tags: unlimited article, image, file and link taxonomy

I was using 4.0, but upgrading to 4.1 didn’t solves the problem. Assigning content to categories with zero articles didn’t fix the problem

I have started from zero deletin the smd_tags tables an reimporting all the stuff from rss_uc. Before an hour reconstructing some dependences, everything looks working ok.

Thank’s!


<txp:rocks/>

Offline

#202 2012-02-01 00:41:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

I’ve just pushed up a new beta which fixes some of the URL-related problems. So in addition to the stuff I mentioned previously this version also:

  • Fixes <txp:smd_if_tag_list> context trigger with empty URL params. Previously it was reporting ‘true’ if you visited a trigger page with no tags and no tag types. e.g. site.com/trigger/article/tag-name, site.com/trigger/article and site.com/trigger all used to return true. Now only the first two do: the latter case returns false so you can detect if the list has no tags in the current context (and then maybe use showall="1" to list all tags in your <txp:else /> branch).
  • Fixes <txp:smd_tag_list> on empty list and non-list pages. Similar to the above, on pages without tag context, <txp:smd_tag_list> would not fire if there were no tag_type/tags in the URL.
  • Fixed <txp:smd_related_tags> when using it inside smd_tag_list with showall="1". This is a similar problem to the above: it now correctly identifies the tag context at all times.
  • Plays better with with gbp_permanent_links when using <txp:smd_tag_name> to link to tag landing pages.
  • Swaps &nbsp; for the code with ‘#160;’ in it that I can’t print here because it gets eaten by Textile. I did this for no other reason than someone said it was a good idea in case anyone is still serving content as XHTML+XML. I reserve the right to be wrong and put nbsp back..

Although I think this version is better and more consistent it has some rather drastic logic alterations behind the scenes, which I hope won’t give anyone any breakage from prior functionality. Please test it and let me know if you spot any regression. Thanks for your continued patience while I tinker with this.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#203 2012-02-02 23:22:37

milosevic
Member
From: Madrid, Spain
Registered: 2005-09-19
Posts: 390

Re: smd_tags: unlimited article, image, file and link taxonomy

Hi, Stef:

I don’t know if it is a bug or it is normal (If it is normal behavior then I’m not understanding well this tag).

This code, used in an article page, works ok form me:

<txp:smd_tag_list showall="1" parent="a-parent-tag">
    <txp:smd_tag_name/> <txp:smd_tag_count/>
</txp:smd_tag_list>

result:

a-parent-tag (0)
a-child-tag (1)
another-child-1 (1)
another-child-2 (0)
another-child-3 (0)

but, when I try to hide the empty tags removing showall=“1” or changing its value to showall=“0”, returns nothing.

If I try to avoid the parent-tag with the param sublevel=“1”, it returns the same tags (the father and the childs).
If I try to avoid the parent-tag with the param exclude=“a-parent-tag”, it also returns the same tags (the father and the childs).
So it looks like sublevel and exclude don’t works, and showall works badly.

Could you show me please a code example for retrieve “tell me wich not empty tags are child tags of a-parent-tag”?

Thanks a lot.

Last edited by milosevic (2012-02-06 12:13:54)


<txp:rocks/>

Offline

#204 2012-02-10 19:57:43

lithium002
Member
Registered: 2011-04-29
Posts: 25

Re: smd_tags: unlimited article, image, file and link taxonomy

Hi,

I was wondering if it is possible to show files in search results that have a certain tag associated with it?

Right now I’m using rah_file_search to show files on based on the search term, but this search excludes files that may have tags associated with them that are relevant to the search.

rah_file_search only shows results if the search term exists either in the title, name or description of the file. Is it possible to have another query that shows files based on smd_tags associated with it?

Offline

Board footer

Powered by FluxBB