Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-12-03 15:32:13

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

only show the latest caption from a certain category

is there a way to only show the latest caption from a certain image category? i found one code snippet which was a combo of wet for each image and upm, and it didn’t work for me. but there has to be a way to do it with just one right?

Offline

#2 2009-12-03 16:59:35

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: only show the latest caption from a certain category

mrtunes wrote:

i found one code snippet which was a combo of wet for each image and upm, and it didn’t work for me.

I’m almost certain wet_for_each_image and upm_image can do that. What was the code that didn’t work?

Offline

#3 2009-12-03 17:25:13

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: only show the latest caption from a certain category

here’s the code:

<txp:wet_for_each_image category="POTW_thisweek"> <txp:upm_img_caption /> </txp:wet_for_each_image>

Offline

#4 2009-12-03 17:38:22

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: only show the latest caption from a certain category

Does this work?

<txp:wet_for_each_image category="POTW_thisweek" sort="date desc" limit="1">
   <txp:upm_image image_id="{id}">
      <txp:upm_img_caption />
   </txp:upm_image>
</txp:wet_for_each_image>

Offline

#5 2009-12-03 19:05:23

mrtunes
Member
From: Toronto, On
Registered: 2007-03-12
Posts: 575
Website

Re: only show the latest caption from a certain category

fantastic, thank you!

Offline

Board footer

Powered by FluxBB