Sidenav accordion menu 5.7
Permalink
I can't believe that there isn't anything in the Marketplace for a multi level accordion side nav. I have tried Auto Nav, Mega Menu and Page List.
I need an accordion (collapsible) side nav to show the current level and 2 levels below that.
Does anyone have any insight on this?
I need an accordion (collapsible) side nav to show the current level and 2 levels below that.
Does anyone have any insight on this?
I'm hoping to use AutoNav. Just not having much luck making a multi-level Collapsible side nav template.
This is what I have that will show and collapse the other sections when opening another. This is using AutoNav custom template.
What I need to do is make it show one more level, so it would start at the Current Level and show 2 more.
foreach ($navItems as $ni) { $classes = array(); if ($ni->isCurrent) { //class for the page currently being viewed $classes[] = 'nav-selected'; } if ($ni->inPath) { //class for parent items of the page currently being viewed $classes[] = 'nav-path-selected'; } if (count($navItems) > 0) { echo '<div class="drop"><ul>'; //opens the top-level menu foreach ($navItems as $ni) { echo '<li class="top_level ' . $ni->classes . '">'; //opens a nav item echo '<a href="' . $ni->url . '" target="' . $ni->target . '" class="' . $ni->classes . '">' . $ni->name . '</a>';
Viewing 15 lines of 26 lines. View entire code block.
$(document).ready(function(){ $(".drop ul>li a ").click(function(){ if($(this).closest("li").children("ul").length == 0) { return true; } if(!$(this).hasClass('nav-path-selected')){ $(".nav-path-selected").removeClass("nav-path-selected"); $(this).addClass('nav-path-selected'); $(this).closest("li").addClass('nav-path-selected'); return false; }else{ return true; } }); });
What I need to do is make it show one more level, so it would start at the Current Level and show 2 more.
Or do you mean you need an off-screen side menu that hides off-screen until called?