We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11054
    • 59 Posts
    I have a decent amount of experience with Wayfinder, but I have a strange situation where I’m trying to create a "Mega Menu" using this Jquery plugin: http://www.sohtanaka.com/web-design/examples/mega-dropdowns/

    I want to maintain the site tree for my client to it’s intuitive for them to edit the site, but as you can see in the Mega Menu example the parents on the secondary level of the menu are in the same unordered list as their children. Essentially, you have this in the HTML:

    <ul><!--Top Nav UL -->
    <li><a href="#">First Level Item</a>
    
    <div class="sub">
    <ul><!--Second level UL -->
    <li><h2><a href="#">Parent of Third level Item</a></h2></li><!--How to get parent to dynamically appear on same level as children-->
    <li><a href="#">Child of Second Level Item</a></li>
    <li><a href="#">Child of Second Level Item</a></li>
    <li><a href="#">Child of Second Level Item</a></li>
    </ul>
    
    </li>
    </ul>
    


    I’ve been racking my brain to try and figure this out, but having problems. Again, for the client’s sake, I’d like to maintain the site tree structure, but somehow trick Wayfinder into putting the parent item in the same unordered list as the child items. I don’t want the child items in a separate unordered list. Any thoughts on how to do this with Wayfinder or a combination of snippets?

    I was initially thinking of using the &categoryFoldersTpl for the parent item, and a blank template for the &innerTpl. But, this doesn’t seem to work.

    Perhaps, use Jquery to remove the third set of <ul> tags....?
      • 22427
      • 793 Posts
      For the second level navigation you could use a Wayfinder call which in its [tt]&rowTpl[/tt] is creating just the [tt]h2[/tt] headlines (which, by the way, should not be links) followed by an extra Wayfinder call for the children:
      [[!Wayfinder? &startId=`[[*id]]` &level=`1` &rowTpl=`subRowTpl` ]]

      The chunk subRowTpl would be this:
      <h2>[[+pagetitle]]</h2>
      [[!Wayfinder? &startId=`[[+id]]` &level=`1` ]]