Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
image based on category
i feel like this is one of those that gets asked a lot. i’m trying to build a conditional for posts. if they belong to a certain category they will get a particular image.
i did try if_article_category with an <else /> statement too, they both didnt work.
<txp:if_article_category name=“blog”>
<txp:ras_if_article_image>
<txp:permlink><txp:article_image thumbnail=“1” /></txp:permlink>
<txp:else />
<txp:permlink><txp:image id=“18” /></txp:permlink>
</txp:ras_if_article_image>
</txp:if_article_category>
Last edited by mrtunes (2009-04-13 02:29:32)
Offline
#2 2009-04-13 03:00:26
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: image based on category
The tag set as you have it above works as advertised for me, what breaks for you?
Offline
Re: image based on category
rsilletti wrote:
The tag set as you have it above works as advertised for me, what breaks for you?
all the images disappear. your ras plugin is working fine though, i checked that.
also i’m not using article custom;
<ul id=‘coolstuff’>
<txp:article form=“cool” limit=“9” pgonly=“0” />
</ul>
Offline
#4 2009-04-13 03:17:15
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: image based on category
I had to re-key quotes around attributes when I pasted the code from the forum?, but there is no reason why if_article_category shouldn’t work – the tag layout makes sense.
Offline
Re: image based on category
rsilletti wrote:
I had to re-key quotes around attributes when I pasted the code from the forum?, but there is no reason why if_article_category shouldn’t work – the tag layout makes sense.
ok got it working! it appears as if categories names are very case sensitive. i think i get confused cause there’s the “name” and the “title”. will pay closer attention to this in the future :)
Offline
Pages: 1