Here is the code I am trying to use to set an active state for category navigation:
{% for category in categories %}
<li {% if craft.request.segment(2) == "{{ category.slug }}" %}class="active"{% endif %}><a href="{{ category.url }}">{{ category.title }}</a></li>
{% endfor %}
It seems that the conditional can't check against the category.slug output. Is this the case? What would be a better approach?
Any help is appreciated.