Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Style active article link
Hi.
I’m developing a site that has several sections. For each section, I have a leftside navigation strip which is a list of the articles within the section. Ideally, I’d like to style this list so that the active article is styled differently.
I’ve tried using the plugin rvm_if_this_article. It works great, except on the landing page. There, nothing is highlighted because it’s a landing page, not an individual article. Can anyone help me make it so that the article that appears on the landing page is styled active?
This seems to be a common question, for I have pored over the forums and found quite a few threads addressing similar questions. There’s one from March of 2009 that looks promising, but it’s a little difficult to follow. None seem to work for me, and I would be very grateful for help. Apologies if you’ve addressed this a million times before.
Thanks —
Ann Foley
Offline
Re: Style active article link
Perhaps a nested conditional, using if_first_article
in combination with if_article_list
, would work.
Code is topiary
Offline
Re: Style active article link
Inevitably, there is more than one way to do this. In addition to jsoo’s suggestion, for instance, the tag <txp:section_list />
has an activeclass attribute. See these items in the excellent TXP Tips for insight and inspiration.
http://txptips.com/section-and-article-navigation-with-txp
http://txptips.com/navigation-menu-using-only-txp-tags
http://txptips.com/highlight-the-active-article-title
Hope this helps and good luck.
Offline
Re: Style active article link
Thanks for the prompt replies! I won’t have a chance to experiment with them until tomorrow, but I’ll definitely post about my results.
Offline
Re: Style active article link
I used this one
http://txptips.com/highlight-the-active-article-title
and it worked perfectly. Many thanks!
Offline
Pages: 1