<p>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:</p>

<pre><code> /^my-site\/news/i
</code></pre>

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

<p>MW</p>

CC BY-SA 3.0
2017-01-05T20:10:53.157Z
Thanks Michael, I would have never come up with that.... Could you elaborate what the `activeClassOnAncestors : true`, does differently?
Nutmeg
CC BY-SA 3.0
2017-01-05T14:27:59.903Z
2017-01-05T14:27:59.903Z
Michael Witwicki
<p>I have a simple nav tag</p>

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

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

<p>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.</p>

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

<p>Any help would be brilliant!</p>

<navigation><menu>
Active class on node with NAVEE
# Active class on node with NAVEE

(Asked by: username_0 on 2017-01-01)

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

      
        {{ node.title }}
        {% ifchildren %}
             {% children %}
        {% 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!

**Tags:** navigation, menu


---

## 1 answers

### Answer by username_1 on 2017-01-05. Score: 2 | Accepted answer

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:
 /^my-site\/news/i

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

> **Comments:**
> **username_0**: Thanks Michael, I would have never come up with that.... Could you elaborate what the `activeClassOnAncestors : true`, does differently?  

---

