Adding class to Auto Nav
Permalink
Hello again!
I am searching for solution about my problem:
I am using Auto Nav in my theme (I am converting HTML layout into C5 theme). The navigation has a similar tree:
<ul>
<li></li>
<li></li>
...
<li class=''>
<ul>
<li></li>
<li></li>
</ul>
</li>
</ul>
This is a menu with submenu one level depth. So I want to add styling to <li> element that contains submenu. By default every <li> element in Auto Nav has an empty style.
I am searching for solution about my problem:
I am using Auto Nav in my theme (I am converting HTML layout into C5 theme). The navigation has a similar tree:
<ul>
<li></li>
<li></li>
...
<li class=''>
<ul>
<li></li>
<li></li>
</ul>
</li>
</ul>
This is a menu with submenu one level depth. So I want to add styling to <li> element that contains submenu. By default every <li> element in Auto Nav has an empty style.
If not, then see the code below, it should make sense. It's the default 5.4 autonav template and you might be using an older one if you are struggling with it.
Mind the if ($ni->hasSubmenu) { part.