Hi
I've used the code below for a navigation structure. (found this example on the forum)
Now I would like to add an 'active' class to the active page.
I've tried something with code in bold, but it's not working, every link is getting active.
Thanks for looking into this!
I've used the code below for a navigation structure. (found this example on the forum)
Now I would like to add an 'active' class to the active page.
I've tried something with code in bold, but it's not working, every link is getting active.
Thanks for looking into this!
- Code: Select all
[b]<cms:set current_page = k_page_title />[/b]
<cms:nested_pages masterpage='index.php' extended_info='1' >
<cms:if k_level_start >
<cms:if k_level='0'>
<ul class="sidebar-nav">
<cms:else />
<ul id="vehicles-dropdown">
</cms:if>
</cms:if>
<cms:if k_element_start >
<cms:if k_immediate_children ='0'>
<li><a href="<cms:show k_menu_link />" [b]class="<cms:if current_page = k_page_title>active</cms:if>"[/b]><cms:show k_nestedpage_title /></a>
<cms:else />
<li><a href="#" id="vehicles-button"><cms:show k_nestedpage_title /></a></li>
</cms:if>
</cms:if>
<cms:if k_element_end ></li></cms:if>
<cms:if k_level_end ></ul></cms:if>
</cms:nested_pages>