dropdown menu autonav

Permalink
I'm trying to get a autonav custom template to display dropdown menus and have been having no luck..
Can somebody help?? I included the view.css

Thanks
Bob

1 Attachment

rdealmeida
 
siton replied on at Permalink Best Answer Reply
siton
Their is no one absolute answer. Each framework or code has it own markup and assets.

Before you start:
Learn how to create the specific drop-down (markup - namespace selectors - assets). Add the markup and assets to your template and see if it works for you fine. If the answer is "work great" start your block template.

Step 1. Add navbar block to your page and Edit autoNav properties to show sub pages (UL inside LI). Now choose your custom template and start edit the view.php

Step 2 - Adapt the autonav markup:
You need to change View.php
Very helpful to un-comment this to control the objects in the array that have "submenu" ("THE PARENT")
if ($ni->hasSubmenu) {
   //class for items that have dropdown sub-menus
   $classes[] = 'your-class';
}


You also can use this IF for example - to add divs or other extra markup
if ($ni->hasSubmenu) {
echo '<div class="my-dropdown"......


very general Structure of autonav:
Open Outer ul      
---------------
                    start loop 1 
                     I am first <li-1>
                          Do i have submenu:  
                          Yes! - so add  <ul-1> inside me
                     end loop 1 (you get <li-1><ul-1>)
                    start loop 2
                          I am the second <li-2> - i am inside <ul-1">
                          Do i have submenu:
                          No :) so close </li-2> + close my "parents" </li-1"></ul-1">
                     end loop 2   (you get <li-1><ul-1><li-2></li-2></ul-1></li-1>
---------------
The loop ends - Close Outer ul
rdealmeida replied on at Permalink Reply
rdealmeida
Hi Siton
Thank you for that.. Do you know I looked right at that and didn't see it.. Couldn't see the forrest cause the trees were in the way..
Anyway.. it took all of twenty minutes..
Thanks Again

Bob