Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#469 2020-05-11 12:54:14

ThomasLeigh
Member
Registered: 2020-05-11
Posts: 24

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

Hello,

I’d like to ask for help with smd_tag. I’ve read several recent pages of this thread and, to be honest, it’s confusing and way over my head, I am definitely not so much into “technical stuff”. But the plugin looks very appealing and I’d love to be able to use it on my website.

Textpattern version: 4.8.0
PHP version: 7.1.33
Plugin ver.: smd_tags_v.0.7.0_zip.txt

I am not sure if I get the following things right:

1. In TextPattern I’ve set:
Admin › Preferences › Site › Article URL pattern › /title

2. I should create a separate section for displaying particular tag-related articles – which should be displayed once I click on any particular tag. I understand it this way: my start page (“default” section) could display a list of recent articles, each article with its own tags. Once I click on any of those tags, the list (section “tags”) of all articles having this tag should be displayed.

3. Therefore I’ve created a section “tags” with “Article URL pattern” set to “/title”. It uses a page called “tags”, on which I’ve put this code:

<txp:smd_tag_list> <txp:smd_tag_name link=“1” title=“1” /> <txp:smd_related_tags section=“article” wraptag=“ul” break=“li”> <txp:permlink><txp:title /></txp:permlink> </txp:smd_related_tags>
</txp:smd_tag_list>

4. In the “Tag Preferenes” › “URL management” I’ve set:
“URL name parameter” › “smd_tag”
“URL type parameter” › “smd_tag”
“Trigger(s) for tag lists” › “tags”

Now, the result is that each tag is linked in the following way:

https://domain.com/tags/article/tagnamehere

and it leads to the error page (“error_default”).

Could anyone help me with that, please?

Offline

#470 2020-05-11 13:25:34

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

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

Hi Thomas. Welcome to the forums, and sorry your first experience is with a slightly broken plugin.

Your setup sounds perfect and you’ve understood it all correctly. This issue is an unfortunate incompatibility between the plugin and Txp 4.8.0. Two things that might work to help address this situation:

  1. Change the plugin load order from 5 to 4 in the Admin->Plugins panel.
  2. If you possibly can, leave all your sections to use the Default permlink scheme. i.e. remove your /title designation for all sections in the Presentation->Sections panel.

That should fix your 404 woes. If it doesn’t, you have two further options:

  • Use an htaccess rule as suggested in this thread a little further up.
  • Install the dev copy of Txp 4.8.1 from GitHub. Though there is no specific fix yet for the permlink issue, there are a number of general improvements which might help. We’re anticipating 4.8.1 to be released very soon, so the code is considered stable enough for production usage. Once the permlink bug is ironed out, 4.8.1 is ready to go.

Hope that helps, and sorry again for the hassle.


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

#471 2020-05-11 22:00:33

ThomasLeigh
Member
Registered: 2020-05-11
Posts: 24

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

@Bloke

Thank You so so much for Your help and detailed explanation :) ! And Your quick reply, thanks to which I am again able to further design my website on TextPattern.

I’ve tried Your advice one by one. What has helped was:

> Change the plugin load order from 5 to 4 in the Admin->Plugins panel.

+ one additional step: change “Article URL pattern” from “/title” to “/section/title”. Now everything seems to be working well!

Offline

#472 2020-05-11 22:18:23

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

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

ThomasLeigh wrote #322921:

Now everything seems to be working well!

Excellent. Glad you can carry on until such time as we fix this. Thank you for using Textpattern and I hope it serves you well.


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

#473 2020-05-31 10:05:29

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

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

Right, let’s try this again.

smd_tags v0.8.0 is released and this should should SHOULD fix the issues with 404son tag lists. There may be a better way for me to handle the URL manager given Oleg’s recent changes to core that we snuck into 4.8.1, but I’ll see about that over the coming weeks.

Thank you for your patience while we hammered this out.


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

#474 2020-06-02 16:01:53

ThomasLeigh
Member
Registered: 2020-05-11
Posts: 24

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

Bloke wrote #323446:

“smd_tags v0.8.0 (…) Thank you for your patience while we hammered this out.

Thank You, I’ve successfully upgraded the plugin, changed the URL scheme into /title and it still works fine.

I just wonder whether is possible not to include “article”, “image”, etc. within links generated by the plugin?

Offline

#475 2020-06-02 23:39:26

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

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

ThomasLeigh wrote #323505:

possible not to include “article”, “image”, etc. within links generated by the plugin?

Glad it’s working okay now.

With regards the tag type, the answer is… partially, yes. Instead of using, say:

<txp:smd_if_tag>
   <txp:smd_tag_list>
      <txp:smd_tag_name title link />
   </txp:smd_tag_list>
</txp:smd_if_tag>

You can instead build the links manually for article types only:

<txp:smd_if_tag>
   <txp:smd_tag_list>
      <a href="<txp:site_url />tags/<txp:smd_tag_name />"><txp:smd_tag_name title /></a>
   </txp:smd_tag_list>
</txp:smd_if_tag>

One caveat is the destination section (tags in this case) is hard-coded in the URL. So if you alter your smd_tags prefs to a different trigger section in future, that won’t automatically be reflected in your URLs.

Secondly, this only works for articles because they’re considered ‘default’ and are thus internally represented via the shortcut URL syntax without type designator. All other types must have a designator, for disambiguation.


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

#476 2020-06-03 14:29:28

ThomasLeigh
Member
Registered: 2020-05-11
Posts: 24

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

Bloke wrote #323516:

You can instead build the links manually for article types only:

Thank You. It works with single-word tags, but in other cases it fails. For example I have a tag “how-to” (tag title “how to”, tag name “how-to”). With standard code the generated link is:

https://trailofthelight.xyz/tags/article/how-to

(it looks the same on the bottom bar while the cursor is hovering over the link)

With the workaround the link is:

https://trailofthelight.xyz/tags/how%20to

(it looks differently on the bottom bar while the cursor is hovering over the link:

https://trailofthelight.xyz/tags/how to

)

As a result tags which have more than one word do not work, due to wrong links.

Offline

#477 2020-06-03 14:35:06

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

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

ThomasLeigh wrote #323532:

tags which have more than one word do not work, due to wrong links.

That’s weird because <txp:smd_tag_name /> returns the name and <txp:smd_tag_name title /> returns the title. So as long as you use the correct tag format in the anchor, it should return your hyphenated tags for use in the URL.


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

#478 2020-06-03 14:44:18

ThomasLeigh
Member
Registered: 2020-05-11
Posts: 24

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

Bloke wrote #323534:

That’s weird because <txp:smd_tag_name /> returns the name and <txp:smd_tag_name title /> returns the title. So as long as you use the correct tag format in the anchor, it should return your hyphenated tags for use in the URL.

I am also surprised. My code is:

<x style='font-size:<txp:smd_tag_info item="weight" />%;'><a href="<txp:site_url />tags/<txp:smd_tag_name />"><txp:smd_tag_name title /></a></x>

My tag from the admin panel: tag title: “how to”, tag name: “how-to”.

I performed a little experiment – I put this within tag cloud code:

title: <txp:smd_tag_name title />
name: <txp:smd_tag_name />

and it results in this:

title: how to name: how to

Offline

#479 2020-06-03 14:47:52

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

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

Bizarre. That’s not what it does on my site. I get “how to” and “how-to”.

*scratches head*

Out of curiosity, what happens if you force the title attribute to be zero?

title: <txp:smd_tag_name title />
name: <txp:smd_tag_name title="0" />

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

#480 2020-06-03 14:53:54

ThomasLeigh
Member
Registered: 2020-05-11
Posts: 24

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

Bloke wrote #323540:

Out of curiosity, what happens if you force the title attribute to be zero?

title: <txp:smd_tag_name title />...

title: how to name: how-to

So it works now :) Thank You very much! :)

Last edited by ThomasLeigh (2020-06-03 14:54:10)

Offline

Board footer

Powered by FluxBB