Skip to main content

Adding 'active' class via matching current url with category.url.

  • February 11, 2019
  • 0 replies
  • 43 views

Hi all.


I'm trying to list up solution categories as menu in header by following codes.


{% for category in portal.solution_categories %}

    {% if category.folders_count > 0 %} 

        <a href="{{category.url}}" class="{% if category.url == ????? %}active{% endif %}">{{ category.name }}</a>

    {% endif %}

{% endfor %}


What I want to ask is the part of '????'. How can I add 'active' class when the page is the category page.

Did this topic help you find an answer to your question?
This topic has been closed for comments