I’m deploying EE on a client site and I feel like I’m struggling against the software to do something that should be very basic. In my experience, this often means I am applying the wrong mental model to the problem at hand.
I have set up categories (developers, resources, etc.) within a weblog (members). I have then posted entries (“Meeting Materials”, “Contacts”) and assigned a single category to each of them. So, there are multiple entries with the title “Contacts”, each assigned to a different category.
I am generating the section navigation from the category list, which is great. I am even generating secondary navigation from the entries with that category assigned to them. Sweet as.
The problem comes when I am in either a category page or an entry and want to determine what category I’m dealing with (for purposes of highlighting nav, etc.). Here’s the code that generates my section nav:
{exp:weblog:categories weblog="members"}
{category_name}
{/exp:weblog:categories}
How would I conditionally add a class=“active” to the span tag for the current category?
Or… should I switch things around and use entries where I’m currently using categories? This should be easy peasy, but it’s throwing me for a loop. Help!