Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2008-02-09 17:16:16
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Article in section but not category?
What combination of tags could I use to say:
If this article is in a section but not category then do this
Thanks for any ideas, I’m quite stuck.
Cheers
Lee
Offline
Re: Article in section but not category?
I’m not exactly sure for your circumstances, but you could try something like this. I think conditional tags will nest fine. There may be a more efficient way – it depends how flexible you need the result to be.
<txp:if_section name=“some_section”>
<txp:if_article_category name=“article_category_you_do_not_want”>
<txp:else />
<txp:article />
</txp:if_article_category>
</txp:if_section>
Swim Kitten, A Magento Site
When nothing but incredibly revealing dresses and swimwear will do
Offline
#3 2008-02-09 18:03:42
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: Article in section but not category?
Thanks for the help, your idea would have worked except that I would need <txp:if_article_category name=“article_category_you_do_not_want”> to accept a list of categories.
Offline
#4 2008-02-09 18:35:03
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Offline
#5 2008-02-09 18:36:22
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: Article in section but not category?
Thank you, I completely forgot about that.
Offline
#6 2008-02-09 18:47:46
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Article in section but not category?
Raina’s example is fine, just use if_article_section instead of if_section when used in individual article mode. Why use a plugin when native TXP tags can do it?
if_article_category does accept a comma separated list of categories :)
Last edited by els (2008-02-09 18:49:42)
Offline
#7 2008-02-09 18:52:55
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: Article in section but not category?
Els wrote:
if_article_category does accept a comma separated list of categories :)
Yeah you’re right, I looked it up after I posted, but somehow it didn’t work in my scenario. Thanks for your suggestion – trying it now.
Offline
Pages: 1