dashik wrote:Is it possible to do this?
I have a secondary navigation menu with my categories...but I'd like to get each one to have an active background color once you're ON that category page.
I've done this many times but never in OC...really all I need is the ability to print the category_id on the main layout.tpl page so I can insert some css code into the <head> like this:
Code: Select all
<style type="text/css">
#cat<?php $category_id;?> a:link {
color: #fff;
}
#cat<?php $category_id;?> a:visited {
color: #fff;
}
#catbg<?php $category_id;?> {
background-color: #677B73;
color: #fff;
}
</style>
And then of course I would label my nav bar with the appropriate css IDs: (let's say this category_id was "2")
Code: Select all
<li id="cat2"><a href="http://www.domain.com/test" id="catbg2">Test Item</a></li>
Thoughts?
I need this is as well, I think I need to go back and look at that breadcrumb function I saw that is used in the header and instead of it being created, to spill it as an array, then we can pick off which cats we want!
Its a bit hacky atm, imho it would be better if there was a broader set of standard set of fields available for each page, thus a designers job would be miles easier as everything they should need to know about the category and product is already there.
Anyway, I'll take a look-see tonight.
Matt