Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#217 2012-04-07 17:39:15

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

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

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#220 2012-04-08 10:00:43

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

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.

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

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

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 is test to smd_if_tag for checking if a tag is the master, first or last in the list
  • Added crumb, head and tail tag 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.

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

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

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#225 2012-04-18 12:46:57

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

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.

Txp Builders – finely-crafted code, design and Txp

Offline

#226 2012-04-18 13:27:41

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

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

You are wellcome. Thanks to you for your work.

Should I download the public version from http://stefdawson.com/sw/plugins/smd_tags ?

The beta link is broken and the public version is called v0.40 and my current installed version sais v0.50 ¿?

Last edited by milosevic (2012-04-18 13:29:48)


<txp:rocks/>

Offline

#227 2012-04-18 13:39:35

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

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

milosevic wrote:

The beta link is broken

Hmm, the 0.50 link works for me


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

#228 2012-04-19 10:14:19

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

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

Hi Stef, a new bug with the last beta.

In an article form, this code was working ok with the previous beta version but now it don’t work:

<txp:smd_tag_list type=“article” wraptag=”“ break=”“>
<txp:smd_if_tag parent=“foo”> do something…
</txp:smd_if_tag>
</txp:smd_tag_list>

I have downgrade to the previous beta version you emailed me on april 5 an this lines of code works again, so it looks to be necessary related with last beta version.

Jorge


<txp:rocks/>

Offline

Board footer

Powered by FluxBB