Hey all-
I’m sure I’ve got a simple problem to solve, but am having a hard time coding it properly. I’ve had several EE “lightbulb” moments, but the bulb still flickers a bit from time to time.
I’ve got a JQuery accordion menu built, and I want to add an “expanded” class to a UL tag if the current entry matches the desired category.
My menu code:
<ul id="menu1" class="menu">
<li><a href="#">Web</a>
<ul{exp:weblog:entries weblog="portfolio"}{if category_id =="4"} class="expanded"{/if}{exp:weblog:entries}>
{exp:weblog:entries weblog="portfolio" dynamic="off" category="4"}<li><a path="portfolio">{title}</a></li>{/exp:weblog:entries}
</ul>
</li>
<li><a href="#">Print</a>
<ul{exp:weblog:entries weblog="portfolio"}{if category_id =="4"} class="expanded"{/if}{exp:weblog:entries}>
{exp:weblog:entries weblog="portfolio" dynamic="off" category="5"}<li><a path="portfolio">{title}</a></li>{/exp:weblog:entries}
</ul>
</li>
</ul>
I don’t know the proper syntax to evaluate the current entry’s category value(s) This isn’t doing it:
{if category_id =="4"}
nor is this, which I also tried:
{if "{category_id}"=="4"}
Any ideas? Thanks!
