Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
get active_class to work in with txp:category_list
I’m using txp:category_list to output a list of categories, which works fine. I even have it styled the way I like.
I want the current category to be highlighted, but I can’t get the active_class attribute to work. Here is the tag:
txp:category_list active_class=“active” break=“li” wraptag=“ul”
And here is the CSS:
.active { color: #fff; background: #7c2c2c; }
When I view the page source, an active class is nowhere to be found.
I’m using Textpattern 4.0.4.
What am I doing wrong?
Mark
Offline
#2 2007-06-20 20:23:41
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: get active_class to work in with txp:category_list
Are you sure you are looking at a category (list) page? It doesn’t work on individual article pages. (Meaning: the category must be in the URL.)
Offline
Re: get active_class to work in with txp:category_list
Can you provide an URL that demonstrates the problem?
Like Els says, the URL should contain ?c=categoryname or /category/categoryname
Last edited by ruud (2007-06-20 20:25:59)
Offline
Re: get active_class to work in with txp:category_list
The URLs work like this:
http://www.example.com/mapleleaf/category/entertainment/
Mark
Offline
Re: get active_class to work in with txp:category_list
Perhaps this FAQ item will help you diagnose the problem. If not, I’d love to see the complete tag trace (explained in the FAQ) and the part of the template that contains the <txp:category_list /> tag.
Offline
Re: get active_class to work in with txp:category_list
I did some hunting around in the forums and found that people couldn’t make active_class work if the name of the category (or section) had a capital letter in it. I went to content:organize:article categories, and changed the names to all lower case. That plus more precision with the CSS did the trick.
Does this count as a bug?
Mark
Offline
Re: get active_class to work in with txp:category_list
Yes, that counts as a bug. Should be fixed in revision 2438
Offline