Textpattern CMS support forum

You are not logged in. Register | Login | Help

#421 2019-01-17 11:12:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,524
Website

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

Vienuolis wrote #316163:

Could you point me please to some examples of public websites with live smd_tags?

There was an estate agent site I knew of a while ago but I can’t remember the URL. If I dig it up, I’ll post it here.

How it deploys or replaces the categories

As jakob says, you can run the plugin independently of categories – set up your own tag hierarchies per content type – or you can optionally link any tag (and, by inference, its children) to a Txp category. If you do that, then changing category on the Write panel will dynamically alter the available tags to only those linked to the chosen category.

This gives an opportunity to narrow down the available tags that users can pick from based on the category, instead of displaying a huge list of tags they need to wade through first. For an etymology site, this might be a game changer!

how to combine it with the search function?

It doesn’t interact with the regular search feature of Txp (you’ll nee to carve your own queries as jakob suggests). The plugin does, however, offer tags that permit the URL to be interpreted in many ways to display content that matches the given tag(s).

If you are dead set against using a trigger word (e.g. example.org/tags) then you can run it without and combine it with the /title-only permlink scheme, but – again as jakob alludes – you may end up with URL clashes. I seem to recall the plugin tries to be clever about it and if you’re using certain permlink schemes it tests articleness, but it’s not foolproof. The risk is yours.

Building a URL that contain multiple tags is something that’s not automatic, unfortunately. The estate agent site I alluded to earlier permitted checkbox sets of tags to be selected in a dedicated search panel. Property type was one tag tree, with detached, semi-detached, terrace, bungalow, etc in it). Another tag tree held a select list of the desired number of bedrooms and each article was tagged with the relevant number it contained.

When the submit button was hit, a few lines of JavaScript constructed a URL based on the selected options and then forwarded the user to that URL (e.g. example.com/propertysearch/detached+5bed) and then the Page template took over to display the matching content.


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

#422 2019-01-17 12:05:06

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,050
Website

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

Vienuolis wrote #316163:

Could you point me please to some examples of public websites with live smd_tags?

A search for smd_tags in the “showcase your site” of this forum returns quite a few results.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#423 2019-01-29 21:26:28

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 28
Website

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

Hi!

I’m trying to display a list of related articles when I click on a tag.
My page template has this:

<txp:smd_if_tag_list>
<txp:smd_tag_list><txp:smd_tag_name /></txp:smd_tag_list>
<txp:smd_related_tags><txp:permlink><txp:title /></txp:permlink></txp:smd_related_tags>
</txp:smd_if_tag_list>

It displays the tag name as expected, but the smd_related_tags returns nothing at all. I’m wondering what it is that I’ve missed.

Also, I have this on my default article form, to display files with the same tags as the current article:

<txp:if_individual_article>
<txp:smd_related_tags type="file" label="Relevanta filer" labeltag="h6" wraptag="div" class="fileDownload" break="">
<p class="four columns"><txp:file_download_link><txp:file_download_name title="1" /></txp:file_download_link> <txp:file_download_description escape="html" /></p>
</txp:smd_related_tags>
</txp:if_individual_article>

and it works fine, except the file_download_name displays the tag title instead of the file title. So I get a long list of files all called “test_tag”.

I’m feeling a bit lost here…

Offline

#424 2019-01-29 22:25:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,524
Website

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

helsinkifrostbites wrote #316343:

I’m trying to display a list of related articles when I click on a tag… It displays the tag name as expected, but the smd_related_tags returns nothing at all. I’m wondering what it is that I’ve missed.

Presumably your smd_tags code is in a dedicated Section to trigger it from the URL? In which case you’ll need to feed <txp:smd_related_tags> with a section attribute to tell it where to look for matching tags. Otherwise it’ll default to “this section” which doesn’t contain any articles.

Also, if you want to show related tags for each tag in a (nested) list of tags you’ll need to move your closing </txp:smd_tag_list> after the closing </txp:smd_related_tags> so it’ll generate a list per tag.

the file_download_name displays the tag title instead of the file title. So I get a long list of files all called “test_tag”.

Drat, that’s a bug. Thank you for finding it. I think I’ve squashed it in the 4.7.0 branch (I assume you’re using the latest version of Textpattern, right?) but I’ll need to do some further tests to check you can still extract the tag title with item="title" when extracting stuff via <txp:smd_tag_info>. Should work, but I haven’t tested it yet.

If you need a bundled plugin that contains the patched code, let me know and I’ll send one over. If you’re okay with copying and pasting just the code block from GitHub over your existing plugin code, then by all means do that instead to patch it for now until I can test and then officially release it. EDIT: released.

Thank you for the report.

Last edited by Bloke (2019-01-29 23:20: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

#425 2019-01-30 07:05:55

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 28
Website

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

Thank you! I knew I was missing something bleeding obvious. Everything works now :)

Offline

#426 2019-01-30 12:54:15

helsinkifrostbites
Member
From: Ystad, Sweden
Registered: 2007-11-16
Posts: 28
Website

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

I get this in the Manage tags prefs when I create a tag with scandi characters (å, ä, ö etc):

Deprecated: Parser::textileThis() is deprecated. Use Parser::parse() instead. in … /textpattern/vendors/Netcarver/Textile/Parser.php on line 2033

Still works fine though.

Offline

#427 2019-01-30 15:05:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,524
Website

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

helsinkifrostbites wrote #316354:

Deprecated: Parser::textileThis()

Drat, forgot about fixing that. I spotted it yesterday as well and it fell out of my head. I’ll fix it today, thanks for the nudge.


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

Board footer

Powered by FluxBB