Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2011-09-11 16:45:51
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Assign an image to more than one category?
Is there a way to assign an image to more than one category? I have a series of images that I would like to display in different parts of the the website depending on the images categories.
Offline
Re: Assign an image to more than one category?
Algaris wrote:
Is there a way to assign an image to more than one category?
Without hacking, no. smd_tags is probably your closest bet right now.
runs for the hills…
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
Online
#3 2011-09-11 22:02:13
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: Assign an image to more than one category?
Whoo! There be gold in them hills. Thanks Steff.
Quick question about smd_tags then. if I tag 5 images with the tag staff
could I output (or display) those 5 images or their thumbnails with the plugin?
Offline
Re: Assign an image to more than one category?
Algaris wrote:
Thanks Steff.
You’re welcome. The next version will be less demanding on your poor server, I promise.
if I tag 5 images with the tag
staff
could I output (or display) those 5 images or their thumbnails with the plugin?
Yes…ish. The key is how you want to display them. One way, which is slow and cumbersome (at present) is detailed in the response to Dwayne. The current set of tags is unfortunately not geared up for this kind of access and I intend to address that in the next release.
But if you don’t mind using the URL to trigger displaying images then that’s the current supported method of doing so. You create a section to house your tags (by default, the plugin pref points to smd_tags
but you can change that). On that Section’s Page flow you can put this:
<txp:smd_if_tag_list>
<txp:smd_tag_list wraptag="" break="">
<txp:smd_if_tag type="image">
<h2>Images that match tag '<txp:smd_tag_name title="1" />'</h2>
<txp:smd_related_tags wraptag="ul" break="li">
<txp:thumbnail />
</txp:smd_related_tags>
</txp:smd_if_tag>
</txp:smd_tag_list>
</txp:smd_if_tag_list>
(it’ll probably issue a bunch of warnings in dev/testing mode, but you can ignore those for now unless you specifically want to use the thumbnail width and height — that’s fixed in my dev version)
With that construct you can direct links to site.com/smd_tags/image/staff
and it’ll show the thumbnails of all images with that tag. Style the container / wraptags to taste.
Judicial use of triggers in the plugin’s prefs can allow you to direct tag lists to other pages instead of making a dedicated section but you need to fashion such URLs yourself and be careful not to clobber your permlink mode (see the URL management section of the plugin help).
So, while it’s not altogether intuitive to do things this way round, I’ll look at improving this aspect when I get round to revisiting the code.
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
Online
#5 2011-09-12 07:25:19
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: Assign an image to more than one category?
Again thank you so much Stef. This will be enough to be going on with. I’m looking forward to your new version already ;-)
And I know your a very busy man, but please could you add unlimited category tagging for Articles, Images. Files and Links in Textpattern 5. In every project I work on it’s something I keep banging my head against.
Offline