Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2018-02-02 18:46:47
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
how to apply CSS class/style to current article_custom ?
how i can assign the CSS class of current_article just to the article which is open ?
<txp:article_custom category="featured">
<a class="current_article" href="<txp:permlink />"><txp:title /></a>
</txp:article_custom>
Offline
Re: how to apply CSS class/style to current article_custom ?
You’re supposed to able to use if_this_article without any attribute, like so:
<txp:article_custom category="featured">
<a<txp:if_article_id> class="current_article"</txp:if_article_id> href="<txp:permlink />"><txp:title /></a>
</txp:article_custom>
but sometimes I can’t get that to work, so I do:
<txp:variable name="this_article"><txp:article_id /></txp:variable>
<txp:article_custom category="featured">
<a<txp:if_article_id id='<txp:variable name="this_article" />'> class="current_article"</txp:if_article_id> href="<txp:permlink />"><txp:title /></a>
</txp:article_custom>
See if that works…
TXP Builders – finely-crafted code, design and txp
Offline