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!
Highlight current category
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Highlight current category
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
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/
# 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/