Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-01-13 23:00:19

bluepurl
Member
From: Prairie du Sac, Wi
Registered: 2009-02-23
Posts: 42
Website

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

#2 2010-01-14 01:19:28

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

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

#3 2010-01-14 03:21:16

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

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

#4 2010-01-14 13:54:15

bluepurl
Member
From: Prairie du Sac, Wi
Registered: 2009-02-23
Posts: 42
Website

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

#5 2010-01-14 23:54:52

bluepurl
Member
From: Prairie du Sac, Wi
Registered: 2009-02-23
Posts: 42
Website

Re: Style active article link

I used this one

http://txptips.com/highlight-the-active-article-title

and it worked perfectly. Many thanks!

Offline

Board footer

Powered by FluxBB