Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-06-20 08:42:32

kevinmcdougall
Member
Registered: 2007-02-08
Posts: 55

How do I display a list of image captions from a specific category?

Hi all,

I’ve been trying to find a way to do this for a while, and recently took a look at it again, but can’t seem to find a way to do this either natively or with a plugin.

Essentially, I want to output a comma-separated list of captions (only the captions) from images from a specific category, or ideally from the category being browsed.

Any ideas?

Offline

#2 2008-06-20 10:02:41

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: How do I display a list of image captions from a specific category?

Probably this can be accomplished natively, otherwise go with smd_query

Offline

#3 2008-06-20 10:06:54

kevinmcdougall
Member
Registered: 2007-02-08
Posts: 55

Re: How do I display a list of image captions from a specific category?

Thanks redebot, will check it out. Definitely looks the part, just a bit wary of the caveat! ;-)

Offline

#4 2008-06-20 10:08:46

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: How do I display a list of image captions from a specific category?

wet_for_each_image does all the heavy SQL lifting.

Offline

#5 2008-06-20 10:51:26

kevinmcdougall
Member
Registered: 2007-02-08
Posts: 55

Re: How do I display a list of image captions from a specific category?

Again, this looks great wet, thanks!

Only had a glance at it and not quite sure how to render the caption yet, but hopefully it’ll all become clear when I’ve had more time to experiement. Hopefully.

Offline

#6 2008-06-20 10:55:57

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: How do I display a list of image captions from a specific category?

You’d probably use upm_image as a companion for rendering the individual caption, as it has a tag for almost any image property, and feed each image from the pre-filtered image set built by wet_for_each_image.

Offline

#7 2008-06-20 11:07:13

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

Re: How do I display a list of image captions from a specific category?

I second that. upm_image and wet_for_each_image are easily the best tools for the job. Would have replied sooner but I got sidetracked, sorry.

Last edited by Bloke (2008-06-20 11:07:58)


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

#8 2008-06-20 11:30:08

kevinmcdougall
Member
Registered: 2007-02-08
Posts: 55

Re: How do I display a list of image captions from a specific category?

Thanks again wet,

Mary’s plugin was my next port of call. On my first attempt I forgot to add the id attribute into upm_image ,which didn’t work and confused the hell out of me, but soon as I added that, it works like a dream.

Every day’s a school day :-)

Offline

#9 2008-06-21 00:58:36

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: How do I display a list of image captions from a specific category?

Here is an odd try at what you are describing. It does what image_index does except it links the caption instead of the thumbnail. I added a nolink attribute to return a list of unlinked captions as text as well. It’s a hack of TXP’s image_index tag so it has all the standard attributes. The only drawback that I can see is the way it’s tied to categories. You can’t just dump a list of captions or select them any other way.

ras_caption_index

Offline

#10 2008-06-21 08:39:15

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: How do I display a list of image captions from a specific category?

You can also try smd_gallery (Why Steve didn’t mentioned about it ;) ?)


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#11 2008-06-21 19:48:26

kevinmcdougall
Member
Registered: 2007-02-08
Posts: 55

Re: How do I display a list of image captions from a specific category?

Thanks all, but wet_for_each_image and upm_image does the job perfectly. I will definitely adding wet_for_each_image to my toolkit from now on.

smd_gallery is great but I already have a plugin for displaying the image galleries might be overkill.

Thanks again!

Offline

Board footer

Powered by FluxBB