I have a simple nav tag

{% set navConfig = {
    'startwithActive' : true,
    'maxDepth' : 2,
    'activeClassOnAncestors' : true,
    'ancestorActiveClass' : 'active',
} %}
    {% nav node in navigation %}

      <li{% if node.class %} class="{{ node.class }}"{% endif %}>
        <a href="{{ node.link }}">{{ node.title }}</a>
        {% ifchildren %}
             <ul class="dropdown">{% children %}</ul>
        {% endifchildren %}
{% endnav %}

This works fine all but with the News section entries. my-site/news adds the active class to the link, but my-site/news/new-entry doesn't add the class to the ancestor.

I have tried most configurations with the available parameters and variables, but I cannot work it out.

Any help would be brilliant!

1 Answer 1


I think what you want to look at is the Regular Expression option under the advanced tab for your my-site/news node. You could add something like:


This way all of the child pages in that section will mark the News page as active.


  • Thanks Michael, I would have never come up with that.... Could you elaborate what the activeClassOnAncestors : true, does differently?
    – Nutmeg
    Jan 5, 2017 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.