Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#145 2011-02-20 15:51:04

jpdupont
Member
Registered: 2004-10-01
Posts: 752

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

Thanks :) !

Offline

#146 2011-02-21 23:50:01

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

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

I’ve found the subdir bug. Stupid mistake. For those that need it now before the official fix is available, find the following line of code in the smd_tag_name function (it’s around line 2878):

$dest = ($permlink_mode == 'messy' || !$cleanurls)
	? pagelinkurl(array('s' => $section, $urlnam => $tname, $urltyp => $smd_thistag['tag_type']))
	: '/'.$section.'/'.(($in_default) ? '' : $urlsec[0].'/').$smd_thistag['tag_type'].'/'.$tname;

And change it to:

$dest = ($permlink_mode == 'messy' || !$cleanurls)
	? pagelinkurl(array('s' => $section, $urlnam => $tname, $urltyp => $smd_thistag['tag_type']))
	: hu.$section.'/'.(($in_default) ? '' : $urlsec[0].'/').$smd_thistag['tag_type'].'/'.$tname;

Just a couple of characters difference at the start of the 3rd line there makes everything happy! Sorry about that oversight. I’ve fixed a few other minor things in my dev copy and have one last big issue to look at on behalf of jakob (a massive query explosion) then I’ll release v0.41 as a bugfix before starting work on any new features.


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

#147 2011-02-25 20:18:18

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

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

Bloke

I don’t recall this being reported, or covered in the docs, but perhaps I missed it. If so, my apologies.

I just installed smd_tags on a site with no article categories.

  • I enabled smd_tags, added three article tags, and went to the write tab. The tags didn’t appear anywhere.
  • I added a couple of categories, and the tags appeared.
  • I had the “link tag to categories” feature set to “off”, so I had not expected it to make a difference whether there were categories or not. Apparently that is not the case.

I would think that the ability to function independently would be preferred, but perhaps this is intentional?

fwiw

Mike

Last edited by maverick (2011-02-25 20:18:51)

Offline

#148 2011-02-26 17:02:07

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

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

maverick wrote:

I would think that the ability to function independently would be preferred

Yes, definitely preferred. It’s a bug that I spotted last week actually and have fixed in the next version. Thanks for the report.


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

#149 2011-03-24 23:19:25

giz
Member
From: New Zealand
Registered: 2004-07-26
Posts: 259
Website

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

Hi Stef – I’m enjoying your plug-in and am only just starting to comprehend what can be done with it :-o

I’ve hit a problem which won’t go away: I’m trying to ‘page’ or ‘chunk’ my output from smd_related_tags:

<txp:smd_related_tags type="article" form="default" class="page1" section="projects" limit="8" />
<txp:smd_related_tags type="article" form="default"  class="page2"  section="projects" offset="8" limit="8" />
etc

Problem is, my limit isn’t working: I ask it to limit to 8 and it displays 3.

My tags are specified like so:

Commercial (2)
—Hospitality (0)
—Industrial (0)
—Offices (1)
—Retail (2)
Cultural (4)
Education (0)
Infrastructure (1)
Public (0)
Residential (25)
—Multi-Residential (9)
—Single Dwelling (16)

and so I suspect the plug-in is only counting root level tags.

Any suggestions as to what I’m doing wrong? The count is wrong whether I use a single smd_related_tags or not…

Can you provide me with an example of how you might use the _match=“tag_level” attribute? I’ve tried everything but the ‘really obvious’ approach…

Thanks

Offline

#150 2011-06-04 12:24:27

Dwayne
New Member
From: Hamburg, Germany
Registered: 2008-11-09
Posts: 7

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

First of all thanks for this plugin. It totally fits my needs for a better image management.

My plan is to tag some images in order to display them on my homepage. I guess the reason why I couldn’t query the tags URLs would be that I already manipulated my pages pretty much. But that’s I ok, since I do not want to make use of those pages.

I played around a bit with a form and the plugin specific template tags, especially smd_related_tags, but without any success. According to textpattern’s debugging information and the SQL queries only the tag name is missing. I did a cross check in PHPMyAdmin and the tag name is the only missing piece in the puzzle. Most likely the problem is that there are no URL params, right? Is there a way to query my tagged images or at least some tag informations without an article or section context?

Offline

#151 2011-06-04 16:06:07

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

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

Dwayne wrote:

thanks for this plugin.

No worries. Hope we can get it to work for you. I do need to desperately revisit this plugin and make it a little lighter on the query count. It’s not particularly clever when dealing with lists of tags right now, but I have some notions on how to fix it.

Most likely the problem is that there are no URL params, right?

If you are using smd_related_tags on its own, then yes. If you want to bypass the URL structure you need to wrap your other smd_tags tags(!) in <txp:smd_tag_list type="image">. That should put it in the right context.

However I’m not sure how successful that will be since it still won’t ‘know’ which images you want to display. This might take some brain power, and I don’t have time to sit down and figure out something better right now. My first stab would be something along these lines, although it’s not exactly efficient:

<txp:images break="">
   <txp:hide> Grab all images...</txp:hide>
   <txp:smd_if_tag name="front-page">
      <txp:hide> ... and filter out only those with the 'front-page' tag</txp:hide>
      <txp:thumbnail />
   </txp:smd_if_tag>
</txp:images>

Downside: as your image count goes up, so will the length of time it takes to process the list. If you could somehow filter the images list first — maybe by category or something — that would help.

I’m sure there must be a better way of only grabbing the images that match a given tag; probably using smd_tag_list and/or smd_related_tags. Sadly, at the moment, they’re probably just as inefficient so you might as well stick with the method above! When I get back to looking at this plugin I’ll certainly consider this use case and see if I can make it better. Thanks for giving me a nudge.

Last edited by Bloke (2011-06-04 16:08:01)


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

#152 2011-06-08 20:23:58

Dwayne
New Member
From: Hamburg, Germany
Registered: 2008-11-09
Posts: 7

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

Ok, i surrender… No way for me to get these images displayed as expected. With your method, Bloke, TXP displays all of my images. I also wasn’t able to identify any rule that would explain the randomness in which TXP displays those images. And even with only some images the request took too much time, as you already predict.

For now I’ll deal with the common categories, but I’m really looking forward for the adaption of this plugin… Thanks again for you help. I’ll keep track on this plugin… :-)

Offline

#153 2011-07-16 17:20:29

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

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

I am using this most beloved plugin (thanks!) on a site, and when I try to output a list of tags associated with an article, I get this error:

Tag error:  <txp:smd_tag_list showall="1" sort="name asc"
     break="" wraptag="div"> ->  Warning: Invalid argument supplied for foreach()  on line 2390
textpattern/lib/txplib_misc.php(653) : eval()'d code:2390 smd_tags_context()
textpattern/lib/txplib_misc.php(653) : eval()'d code:3254 smd_tags_context()
textpattern/publish.php:1188 smd_tag_list()
textpattern/publish.php:1113 processtags()
textpattern/lib/txplib_misc.php:1706 parse()
textpattern/publish/taghandlers.php:314 parse_form()
textpattern/publish.php:1188 output_form()
textpattern/publish.php:1100 processtags()
textpattern/publish.php:538 parse()
index.php:45 textpattern()

This is being generated by the sidebar taglist. The error doesn’t appear when I remove the “related tags” list from the article, though. It only appears when I have both the article list of related tags and the sidebar list of all tags.

EDIT: I think it’s something to do with the implementation of the plugin and the URL structure of my site. It’s using clean Section/ID/Title URLs, and I haven’t figured out what I need to enter in the trigger area to get it working correctly.

Last edited by frickinmuck (2011-07-16 21:57:44)


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

#154 2011-07-16 22:22:23

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

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

frickinmuck wrote:

The error doesn’t appear when I remove the “related tags” list from the article

Hmmm, maybe the tag_list in the sidebar is destroying the ‘context’ of the related tags (or vice versa). Would you mind sharing your tag code for both article and sidebar so I can try your setup directly on my server. I guess the sidebar code is the same as that shown in the error block you posted above, but I’d like to try it as you have it now, in case you’ve tweaked it since.

It’s using clean Section/ID/Title URLs, and I haven’t figured out what I need to enter in the trigger area to get it working correctly.

Double hmmm, I can’t recall trying it with that permlink structure: perhaps an oversight on my part. Can’t see why it would complain though, but anything’s possible. I’ll test it and see if I can figure this out.

Last edited by Bloke (2011-07-16 22:33:29)


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

#155 2011-07-16 22:56:38

frickinmuck
Member
Registered: 2008-05-01
Posts: 118

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

Ah, thanks! Here’s the sidebar code:

<txp:smd_tag_list showall="1" sort="name asc"
     break="" wraptag="div">
   <txp:if_different>
      <h2 class="alphachar"><txp:smd_tag_info item="lettername" /></h2></txp:if_different>
   <span class="atag">
      <txp:smd_tag_name link="1" wraptag="span" />
      <txp:smd_tag_count /><br />
   </span>
</txp:smd_tag_list>

And here’s the article code:

<div class="tag-display">Tags: <txp:smd_related_tags type="article" wraptag="span" break="," /></div>

I’m using this in the blog section of a site, and I had added “blog” as the trigger. I think that’s the most likely area where something could be going wrong, as I admit I don’t understand that setting at all. :^)


The AI does not hate you, nor does it love you, but you are made out of atoms which it can use for something else.

Offline

#156 2011-07-16 23:35:23

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

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

frickinmuck

Thanks for the code. It works fine on my site but then I’m using the in-development version which may have fixed any bugs in v0.40.

Having said that, I have not set it up with my ‘blog’ section as the trigger. And you’re right, that may be the problem so let’s explore that first.

The trigger(s) are — at their simplest — sections of your site that you want to treat as ‘tag list’ pages. So if you set the trigger to blog, taglist then visiting either site.com/blog or site.com/taglist would trigger ‘tag mode’. Tag mode allows you to filter tags by the URL, e.g. site.com/taglist/muppets would give you info about the article ‘muppets’ tag. site.com/taglist/image/muppets would give you info about the image ‘muppets’ tag. On the landing page of that section, you can put smd_tag_list tags and other smd_tag display tags to format the output — show counts, links to other tags, articles, whatever.

In your case, setting your trigger to ‘blog’ probably means that visiting a real article at site.com/blog/42/the-meaning-of-life triggers smd_tags to wake up. It looks at the URL, sees 2 portions after the ‘blog’ bit and assumes they are the tag type and tag name, respectively. Thus it tries to display info about the tag called ‘the-meaning-of-life’, of type ‘42’. Since ‘42’ is not a valid tag type (you need to use article, image, file or link) the plugin’s probably just collapsing into a pile of broken 1s and 0s.

I should guard against that actually so it doesn’t error out — I’ll see if I can do that. But in the meantime, try setting your trigger to some section you intend to dedicate to URL-based tag trickery, or just empty that setting out and try again.


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