Hey guys,
So I know couch has a way to add an active class to the current menu link... However, I generally use a small jQuery snippet via a conditional: if this.href == window.location.href, add an active class to some <a> tag and its parents (if it's a nested menu)...
This snippet doesn't work anymore after activating pretty urls..
So I decided to try the couch way of doing things.. Please note that the client does not need to change things around in the menu, so there's no requirement for that in the CMS. From the blog tutorial, I used the code like this: <li><a href="<cms:link 'about-ithickal.php' />" <cms:if k_template_name=='about-ithickal.php'>class="nav-active"</cms:if>>About Ithickal</a></li>
The above code works, unless the menu is a nested menu.
The issue is that this is a click menu, so I need the active class to show on a parent li tag of the active menu link as well (i.e. the parent li has no url, but only reveals the dropdown menu on click). Is this a way to do this?
So I know couch has a way to add an active class to the current menu link... However, I generally use a small jQuery snippet via a conditional: if this.href == window.location.href, add an active class to some <a> tag and its parents (if it's a nested menu)...
This snippet doesn't work anymore after activating pretty urls..
So I decided to try the couch way of doing things.. Please note that the client does not need to change things around in the menu, so there's no requirement for that in the CMS. From the blog tutorial, I used the code like this: <li><a href="<cms:link 'about-ithickal.php' />" <cms:if k_template_name=='about-ithickal.php'>class="nav-active"</cms:if>>About Ithickal</a></li>
The above code works, unless the menu is a nested menu.
The issue is that this is a click menu, so I need the active class to show on a parent li tag of the active menu link as well (i.e. the parent li has no url, but only reveals the dropdown menu on click). Is this a way to do this?