Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#211 2012-04-01 23:25:00
Re: smd_tags: unlimited article, image, file and link taxonomy
saccade wrote:
I work on a very new release (3685).
Unfortunately smd_tags doesn’t work reliably in SVN yet. I’m not sure why, but even when I set the plugin type to ‘5’ I just get the save spinner going forever when saving an article. I think it’s to do with the fact I’m returning a hunk of HTML (the result of a selectInput()) to be rendered directly to the admin side, instead of returning javascript (or something) and rendering it using jQuery on the client side.
Thing is, if that is the case, it’ll be a real pain to have to do all DOM creation client side as I can’t then use the core’s nice admin side widget rendering functions. It’s probaby just me not having read the code proplerly though — perhaps I’ve neglected to specify what ‘type’ of information is being returned and it’s defaulting to javascript. Thus, when it doesn’t get javascript, the core is complaining.
I’ll need to dive into this a bit more deeply and find out why the plugin’s AJAX is being rejected. Until then, sorry, no workee.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#212 2012-04-04 20:59:51
Re: smd_tags: unlimited article, image, file and link taxonomy
saccade / all
I’ve fixed the save button bug, yay. And in the past couple of days I’ve added a truckload more stuff including the concept of… fanfare… master tags.
What you can now do is nominate one tag as a “master” in the prefs. Any tags you stash under here (it’s the same name for all content types) will be always available, regardless of your category linking prefs. So you can have the best of both worlds: a reduced tag set based on the categories currently selected as well as being able to pick from a core list alongside.
I’ve got a few loose ends to tie up with the idea. At the moment I’m undecided what to do with the master tag in tag lists. By rights, since it’s not really a proper tag in itself — just a placeholder — it should be omitted. But if you wanted to display its name on the public side for some reason then I don’t think the plugin should prevent you from doing that. So what I’ve done is to add an is_master boolean check to the <txp:smd_if_tag> tag. If you don’t want to show it in the lists you can detect the tag and omit it.
I’ve had some great success with naming the master tag ‘0’. That means the ‘global’ tags beneath it always appear at the top of lists. Along with this change, I’ve permitted you to choose whether you want users to be able to select the parent tag assigned to categories (a.k.a. “red leader”, “wing commander”, insert Star Wars analogy here). That’s mighty handy as it means you can designate parent tags as off-limits while still populating a nice tag hierarchy beneath.
Oh, and did I mention:
- Multi-tag searches — both AND and OR — are done so you can find articles that contain tag A OR tagB, or find images that contain tagA AND tagB AND tagC… from the URL.
- I’m halfway through bi-directional tag searching (pick a child tag and its parents or children (or both) are automatically assumed to be included in the list). It works on the public side, I just have to fix it up for the content panels on the admin side.
- I’ve added (Textile-able) tag descriptions which opens things up massively for creating self contained, descriptive taxonomies so visitors know what each tag is for. You could even assign an image ID to each tag if you wished and display it on your site. One thing I’m toying with is offering a tooltip as you hover over the item in the list / tag set so if you don’t know what a tag is, the description pops up. Really handy when assigning tags on the Write tab. I can do it for tag lists easy enough, but doing it in a select dropdown is trickier. I think it’s possible with some jQuery magic: investigation underway.
Plus there’s the speed and server load / cacheing improvements, a host of niggly fixes and an improved admin tab.
After over three years of work and procrastination, it’s finally starting to kick butt! Mind you, at around 4000 lines of code it ain’t small…
Although I’ve a little way to go yet, it’s stable enough to run so if anybody wants a copy, please raise your hand and let me know if you want a vanilla 4.4.1 or SVN version — the only difference is the plugin type.
Hang in there. The future’s bright; the future’s tagging.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#213 2012-04-04 21:17:51
- saccade
- Plugin Author

- From: Neubeuern, Germany
- Registered: 2004-11-05
- Posts: 521
Re: smd_tags: unlimited article, image, file and link taxonomy
you are great!
<txp:sac_raise_hand name="svn" />
Offline
#214 2012-04-05 07:34:51
- milosevic
- Member

- From: Madrid, Spain
- Registered: 2005-09-19
- Posts: 390
Re: smd_tags: unlimited article, image, file and link taxonomy
I’m really excited expectating this new release. I’m building a new site based on smd_tag, it will be nice to test the new version. Thanks Bloke.
<txp:rocks/>
Offline
#215 2012-04-05 08:54:36
- milosevic
- Member

- From: Madrid, Spain
- Registered: 2005-09-19
- Posts: 390
Re: smd_tags: unlimited article, image, file and link taxonomy
Thanks for the copy, Bloke. I’m working in a really slower hosting for developing my site and the first impression of v.05 is that it is very much faster than previous version: nice work. I will test it in the further days and will report any founded problem.
Last edited by milosevic (2012-04-05 08:55:19)
<txp:rocks/>
Offline
#216 2012-04-07 16:25:36
- milosevic
- Member

- From: Madrid, Spain
- Registered: 2005-09-19
- Posts: 390
Re: smd_tags: unlimited article, image, file and link taxonomy
Hello, Bloke:
I found an unusual behavior of <txp:page_url/> when using it in an smg_tags page. I don’t know if it is a bug or if I’m not understanding somethink.
having this page:
/smd_tags/article/my-tag?foo1=value1&foo2=value2
if I use <txp:page_url/> on it the result is
/smd_tags/?foo3=my-tag&foo4=article&foo1=value1&foo2=value2
I’m using adi_gps for some stuff so foo3 can be a consecuence of that, but this one:
foo4=article
looks like if <page_url/> where unable to catch “/smd_tags/article/” and returns “/smd_tags?foo4=article” on its place.
<txp:rocks/>
Offline
#217 2012-04-07 17:39:15
Re: smd_tags: unlimited article, image, file and link taxonomy
milosevic,
Number of plugins directly modify and alter server configuration variables including the request_uri, that you are trying to access. One of these plugins is smd_tags. Other common plugins that do it are MLP, and gbp_permanent_links.
If you use any of these plugins that directly change server configuration variables, well, as it stands, unfortunately you may not really trust the values you are given as they are not correct. The way smd_tags works, you can’t get the actual requested URL. The URL smd_tags presents is “faux”, and is later on “translated”, or “transformed” to the real deal.
When it comes to Textpattern most of these plugins, including smd_tags, that do this, are trying to fool Textpattern to show a page that wasn’t actually requested. This to make TXP to understand a URL that it couldn’t otherwise trust or translate. Whether all these plugins (not directed to smd_tags) are implementing this functionality correctly is entirely other thing. Some have no choice, others could do better job at parsing.
Hopes are that one day Textpattern has truly extendable page/URL handler/router, and plugin’s don’t have to alter anything.
Offline
#218 2012-04-07 20:09:46
- milosevic
- Member

- From: Madrid, Spain
- Registered: 2005-09-19
- Posts: 390
Re: smd_tags: unlimited article, image, file and link taxonomy
Mmmm.
Then I must check manually wich variables are in play in order to build my own URL checker, ok. I was trying to avoid that way but, if there’s no other way, then that is the right way :-)
Thanks, Gocom!
<txp:rocks/>
Offline
#219 2012-04-08 08:44:46
Re: smd_tags: unlimited article, image, file and link taxonomy
As Gocom says, this is partly an inherent design decision flaw in Txp’s URL handling system which means plugin authors find inventive ways round it, often breaking things or not playing well with other plugins. Core patches to improve the situation are always welcome.
But essentially yes, the smd_tags URL handler is quite lame. It should take into account other URL params actually. From memory I think it just ungracefully lops them off, which is very poor EDIT: no, it keeps them. What is it that you actually want to see as a result of the <txp:page_url />?
Last edited by Bloke (2012-04-08 09:51:38)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#220 2012-04-08 10:00:43
Re: smd_tags: unlimited article, image, file and link taxonomy
milosevic / all
Bear in mind that if you are using a regular article page as a tag landing page you have to be careful what you wish for. Example:
site.com/articles/my-article
That’s a regular Txp article in /section/title permlink mode, but if you designate articles as a tag landing page, the plugin will trigger the above URL as a tag list when using <txp:smd_if_tag_list>, irrespective of whether it’s a tag or an article.
Look at it from the plugin’s viewpoint: how does it know it is or isn’t an article? How does it know it’s a tag? Answer: it doesn’t. What if you had a tag the same name as an article?
Incidentally, if you switch permlink modes to section/id/title then the situation goes away. Another way round it is to explicitly set the tag type in your URLs. e.g. site.com/articles/article/my-article-tag.
While theplugin preserves existing foo1=val1&foo2=val2 URL params and tacks them on the end, it triggers the plugin’s tag sysem by injecting two new params into the URL: by default they are smd_tag and smd_tag_type (what milosevic refers to as foo3 and foo4 respectively in his above post, and can be changed in the plugin prefs). Thus the tag name (foo3=my-tag) and tag type (foo4=article: it could equally be image, link or file) will show up in all Textpattern tags or plugins occuring later in the page that deal with URLs.
I don’t really know of a way round this. If I leave the URL alone, Textpattern will 404, which is undesirable. If I strip off any smd_tag-specific URL portions and put them as quiet URL params behind the scenes, some txp:tags will be affected. If anybody has a clean solution (even a core one!) to help out with URL wrangling then I’d love to see it.
Last edited by Bloke (2012-04-08 10:02:54)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#221 2012-04-08 12:41:04
- milosevic
- Member

- From: Madrid, Spain
- Registered: 2005-09-19
- Posts: 390
Re: smd_tags: unlimited article, image, file and link taxonomy
Thanks, Bloke.
In my particular case I’m not using any article as tag landing page, but I will keep your comments in mind.
<txp:rocks/>
Offline
#222 2012-04-11 12:33:35
Re: smd_tags: unlimited article, image, file and link taxonomy
The latest iteration of the beta is here for Txp 4.4.1. Although it’s written for 4.5.0 it will (just about) run in 4.4.1. For those running SVN you should change the plugin type to 5 in phpMyAdmin after installation.
Brief rundown of features:
- More performance improvements via cacheing
- Rewrote URL handler to make it play better with other tags and remove the messy tags in the URL
- Added tag descriptions
- Enabled AND/OR multi-tag search option from the URL
- Added master tag support
- Permitted bi-directional tag tree searching (done on public side only so far)
- Permitted nested smd_tag_list tags (thanks sacripant)
- Permitted tag parents assigned to categories to be removed from lists (thanks pieman)
- Added
istest to smd_if_tag for checking if a tag is the master, first or last in the list - Added
crumb,headandtailtag list flavours - smd_related_tags: added DB columns from recent Txp releases
- Fixed (ahem, hid) information_schema warning on new installs (thanks jayrope)
- Fixed missing tag lists if no categories defined
- Fixed bogus URLs in subdir installs in smd_tag_name (thanks sacripant / jpdupont)
- Fixed SQL error when deleting non-orphan tags (thanks tye)
- Fixed if_tag_list context trigger with empty URL params
- Fixed smd_tag_list on empty list and non-list pages
- Made smd_tag_name play with gbp_permanent_links
- Fixed smd_related_tags in showall context
Phew! I bumped the revision from 0.41 to 0.50 because of the URL handler changes. Should remain backwards compatible. Still a little way to go, but I’d appreciate feedback on this one please. Thanks in advance.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#223 2012-04-18 08:38:20
- milosevic
- Member

- From: Madrid, Spain
- Registered: 2005-09-19
- Posts: 390
Re: smd_tags: unlimited article, image, file and link taxonomy
Hi, Stef:
I’m using the last beta and I think there’s a little problem:
Writing a new article, the smd_tags selection is not saved with it. After saving the new article, if I edit it and assign tags to it the tags info is saved ok.
I’m using Select list method and no Quick tag for displaying tags in the write tab.
<txp:rocks/>
Offline
#224 2012-04-18 09:59:51
Re: smd_tags: unlimited article, image, file and link taxonomy
milosevic wrote:
Writing a new article, the smd_tags selection is not saved with it.
Yowzers, confirmed bug, thanks. Interestingly, the very latest set of updates to SVN make this process even harder as I need to validate stuff as well. I’m getting ‘form submission error’ messages this morning every time I update an article and my tags get wiped out. Hmmmmmm. Thought it was to do with rss_unlimited_categories failing the validation step but it’s still not working after disabling it. Maybe another plugin is tripping this; smd_write_cats perhaps. Will investigate.
I’ll get a new version out as soon as I can with the fixes in place.
Last edited by Bloke (2012-04-18 10:07:24)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#225 2012-04-18 12:46:57
Re: smd_tags: unlimited article, image, file and link taxonomy
Try that and let me know if it’s any better. Thanks again for spotting the bug.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline