Drupal 7 - Active menu items does not have active-trail class

473 views Asked by At

As mentioned in the title, for some reason, particular menu items that have active class do not have active-trail class and so do their parents.

Example menu tree when I am currently at page Test2:

<ul class="menu">
    <li class="first expanded">
        <a href="/test" class="active">Test</a>
        <ul class="menu">
            <li class="first expanded">
                <a href="/test2" class="active">Test2</a>
            </li>
        </ul>
    </li>
</ul>

This is how should it be when I am currently at page Test2:

<ul class="menu">
    <li class="first expanded active-trail">
        <a href="/test" class="active active-trail">Test</a>
        <ul class="menu">
            <li class="first expanded active-trail">
                <a href="/test2" class="active active-trail">Test2</a>
            </li>
        </ul>
    </li>
</ul>

Any help is appreciated.

1

There are 1 answers

1
osman On

It's more likely that your theme (or a module) is overriding the output using one of these hooks and changing the classes:

I'd recommend starting with checking out the active theme's code.

Or you can just implement theme_menu_link() in your theme and override the classes to your liking.