Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Turn on/off a category
Hi all, i’m looking for a way to “turn on/off” a specific category. I’m quite sure there isn’t a plugin to do that, but for me it would be VERY useful to be able to show (or not) all the articles associated with a specific category.
This, because i use categories to determine the position of the articles in the homepage of my online newspaper, and each category outputs only to the last article: sometimes, i need more “positions” (as i’ve got more articles to publish), and that’s why i’m asking this question.
Thanks in advance,
Vittorio
Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com…
Offline
#2 2006-12-01 15:50:20
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Turn on/off a category
It sounds like you are looking for this; if_article_category
For list capability and a little finer control if you need it:
ras_if_article_category
Offline
Re: Turn on/off a category
(rick i’ll complete some code if you don’t mind:)
<txp:if_article_category name=“this-cat-hides-in-the-bushes”>
<txp:else />
all other visible cats playing in the garden
</txp:if_article_category>
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: Turn on/off a category
Mmm… thanks guys, but maybe i sould explain it better. I need some magic to hide a certain category (hence all the articles it contains) that doesnt require to alter the code everytime. Something like the radio buttons you use to set the state of an article (live, sticky, hidden…), but for categories. Quite tricky, i know…
Happily served with Txp: Strampelli.net, Brain Essence, NicolaTranfaglia.com…
Offline
#5 2006-12-02 17:10:54
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Turn on/off a category
The radio button option isn’t available. The tags as shown would go in an article form and would be applied recursively to each article returned by the article tag, only one form required. Have you tried using sections? the way they behave is more powerful that way.
Offline
Pages: 1