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

  • 11 February 2019
  • 0 replies
  • 38 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.



This topic has been closed for comments