Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-04-02 10:23:57
- K2member
- Member
- Registered: 2006-10-24
- Posts: 19
Highlight category in sidebar if category or article in categoy active
Hi.
In my navigation I’ve got a custom list of categories:
<ul>
<li><txp:category link=“1” title=“1” name=“category1” /></li>
<li><txp:category link=“1” title=“1” name=“category2” /></li>
<li><txp:category link=“1” title=“1” name=“category3” /></li>
</ul>
Now I want to show a “>” in front of the category-link if either the category itself or an article in it is opened.
I tried this (for each category):
<txp:if_category name=“category1”> ›
<txp:else />
<txp:if_article_category name=“category1”> › </txp:if_article_category>
</if_category>
But of course this produces an error since the if_article_category is executed for the two other categories.
Offline
Re: Highlight category in sidebar if category or article in categoy active
Here is mine code:
<txp:category_list break="" wraptag="ul" parent="article" exclude="article" form="category_list" />
Form category_list:
<li
<txp:if_article_list>
<txp:if_category name='<txp:category />'>
class="active"
</txp:if_category>
<txp:else />
<txp:if_article_category name='<txp:category />'>
class="active"
</txp:if_article_category>
</txp:if_article_list>
>
<txp:category name='<txp:category />' this_section="0" section="" link="1" title="1" />
</li>
This examples marks li
both in article_list and individual_article cases.
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
#3 2009-04-02 11:12:07
- K2member
- Member
- Registered: 2006-10-24
- Posts: 19
Re: Highlight category in sidebar if category or article in categoy active
Thank you, I used your conditionals and it works just fine.
Offline