Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#397 2018-03-01 18:10:37

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

Is there a naming convention for tags?

Somehow i can only get tag result lists from smd_related_tags, when the tag name has only one word in it.

As soon as i use
Design company which names to design-company or word1 (word2) which names to @word1-word2
the result is not a list anymore, but just the note, that the tag has x entries. Page source shows nothing else as well, not even surrounding html tags.

Bug or naming convention?


A hole turned upside down is a dome, when there’s also gravity.

Offline

#398 2018-03-01 18:20:27

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

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

jayrope wrote #309555:

can one also establish sthg. like <txp:smd_related_tags custom_2="Berlin" form="sitemap_secondary" /><txp:smd_related_tags city="Berlin" form="sitemap_secondary" />

I’m not entirely sure what you want to achieve, but <txp:smd_related_tags> can compare any field in any context. Combined with tags-in-tags you should be able to tie your content in some pretty cool knots.

Look at the documentation for that tag’s match attribute. It defaults to comparing tag_name, but you’re not restricted to finding tags in that field:

<txp:if_custom_field name="genre">
    <txp:smd_related_tags match="genre">
        <txp:permlink><txp:title /></txp:permlink>
    </txp:smd_related_tags>
</txp:if_custom_field>

If you populate your custom field called “genre” with a tag name, that’ll go and find other articles with that tag. Heck you can pull out related files with the tag defined in your article’s custom field if you add type="file" to the above smd_related_tags.

Just remember that when you’re matching stuff like this it always matches the tag name not it’s title.


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

#399 2018-03-01 18:38:12

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

Bloke wrote #309557:

<txp:if_custom_field name=“genre”> <txp:smd_related_tags match=“genre”> <txp:permlink><txp:title /></txp:permlink> </txp:smd_related_tags>
</txp:if_custom_field>

Ai. I didn’t realize smd-related_tags could be enclosing. And yes, name tag, not title tag. Thank you much!


A hole turned upside down is a dome, when there’s also gravity.

Offline

#400 2018-03-10 15:49:44

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

EDIT: Solved. smd_related_tags needs to have match="tag_name" set to enable display of entries using multi worded tags. Original question below.

Sorry to ask this again, Stef.

on the tags_results page you set up for me i can see lists of articles belonging to a specific tag only, when the specific tag only consists of one word.

The tag Designer for instance gives me an article count first, followed by a list of articles per title, that is tagged with Designer. That’s expected behaviour.

_But strangely, when i use double worded tags, like Designer (company) or Producer (movie) etc.
then i get the article count only, and no list of articles, which are tagged like that. This goes for any tag, that is longer than one word._

Is that a bug or my coding inconsistency? EDIT: My coding inconstency ,)

Thank you much in advance!

Last edited by jayrope (2018-03-15 12:54:22)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#401 2018-03-18 00:15:12

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

Another one of my simple questions, pardon me, please!

If i look for multiple tags, like tag1+tag2 i get results displayed individually for each tag in different lists.
How can i only display the articles containing all tags in one list?
Only to see the crossreferencing results?

Thank you.

Last edited by jayrope (2018-03-18 00:16:03)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#402 2018-03-18 12:00:32

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

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

jayrope wrote #310097:

How can i only display the articles containing all tags in one list?

On your tag list / filter landing page, use <txp:smd_related_tags section="your-section-here" /> without any surrounding <txp:smd_tag_list>.

Reason: the smd_tag_list tag will iterate over all the tags and show you articles with each tag individually, so if you want to see the combined results, don’t iterate!


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

#403 2018-03-18 20:51:08

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

That does work.
Minor drawbacks are, that count and tag name are only shown in the results list, when smd_related_tags is enclosing.


A hole turned upside down is a dome, when there’s also gravity.

Offline

#404 2018-03-18 21:31:40

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

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

jayrope wrote #310115:

Minor drawbacks are, that count and tag name are only shown in the results list, when smd_related_tags is enclosing.

Not sure I understand, sorry. What are you trying to display about the articles that match?


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

#405 2018-03-18 21:44:04

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

I noticed, that when smd_related_tags is not enclosing i cannot use smd_tag_count or smd_tag_name to show to the searcher, what they have searched for and how many there are. Both need to be enclosed by smd_related_tags to work.


A hole turned upside down is a dome, when there’s also gravity.

Offline

#406 2018-03-19 11:03:30

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

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

jayrope wrote #310117:

I noticed, that when smd_related_tags is not enclosing i cannot use smd_tag_count or smd_tag_name to show to the searcher, what they have searched for and how many there are. Both need to be enclosed by smd_related_tags to work.

Can you post a snippet of your template code so I can take a look please? It works in my tests but maybe I’m not doing it the same as you.

Incidentally I’ve just pushed a change to the 4.7.0 branch of the plugin on GitHub that permits you to check the search_mode. Example:

<txp:smd_if_tag search_mode="and">
  <h2>Articles matching selected tags</h2>
  <txp:smd_related_tags section="articles" wraptag="ul" break="li" />
    Show <a href="<txp:site_url /><txp:section />">all tags</a>.
<txp:else />
  <!-- Articles matching each tag in turn -->
  <txp:smd_if_tag_list>
    <txp:smd_tag_list>
      Other articles with tag <txp:smd_tag_name title="1" link="1" />
      <txp:smd_tag_count />
      <txp:smd_related_tags section="articles" wraptag="ul" break="li" />
    </txp:smd_tag_list>
    Show <a href="<txp:site_url /><txp:section />">all tags</a>.
  <txp:else />
    <h2>All tags</h2>
    <txp:smd_tag_list showall="1">
      <txp:smd_tag_name title="1" link="1" />
      <txp:smd_tag_count />
    </txp:smd_tag_list>
  </txp:smd_if_tag_list>
</txp:smd_if_tag>

Options for the search_mode attribute are:

  • andURL uses the AND tag combinator defined in prefs
  • orURL uses the OR tag combinator defined in prefs
  • singleURL only represents a single tag

EDIT: and remember, from 4.7.0, you can use the core attribute not:

<txp:smd_if_tag not search_mode="single">
   // URL uses either an OR combinator or an AND combinator 
</txp:smd_if_tag>

Last edited by Bloke (2018-03-19 11:25:59)


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

#407 2018-05-27 19:01:44

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

After updating to Textpattern 4.7 (and accordingly smd_tags to 0.60) the smd_tag landing section only shows an error 404. The section is called “filter” (it does exist) and formerly showed a tree of all used tags with counts before. Is there any simple idea, why this could have changed?

Last edited by jayrope (2018-05-27 19:03:30)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#408 2018-05-28 21:39:21

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

Okay, adding to my last post i found out, that for some weird reason, the landing section mentioned in the URL_management prefs for smd_tags results is replaced by the error_default page.
I can’t see why this happens, overview in sections tells me all is good.

EDIT: Any section i unlist from the list of trigger sections has the 404 disappear, and displays that section properly again.

But obviously the form containing smd related tags on the page doesn’t display anything then. A <txp:else /> no tag list in the end of that form at least properly returns “no tag list”.

I can’t see any further and hope a TXP 4.7.1 version will just correct that error… (?).

Last edited by jayrope (2018-05-31 12:00:51)


A hole turned upside down is a dome, when there’s also gravity.

Offline

Board footer

Powered by FluxBB