Highlight current category

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
mo
Regular
Posts: 40
Joined: Sun Jan 27, 2008 11:33 pm
Contact:

Highlight current category

Post by mo »

What would be the best way to go if I want the current category in the category list to be highlighted when viewing a category or article?

Thanks!
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Highlight current category

Post by garvinhicking »

Hi!

I assume you're talking of the serendipity_plugin_comments sidebar plugin.

You'd have to use the smarty template for the categories plugin in that case, then edit the plugin_categories.tpl file. The current category is inside {$category} that you can compare to the category ID inside the foreach-loop of the sidebar plugin.

Getting the ID of an entry that is being viewed is not as easy. The best way to get this is actually to use the serendipity_event_categorytemplates, which has an option to forcible set the category-ID of an entry to the global category variable. This is a tad advanced, I don't have th etime to look it up properly right now, so maybe the pointer alone helps.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply