We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30672
    • 180 Posts
    hi !

    wayfinder call : (yo

    [!Wayfinder? &startId=`0` &level=`3` &outerTpl=`menuContainer` &outerClass=`dropdown dropdown-linear dropdown-columnar` &parentClass=`category` &innerTpl=`innerContainer` &innerRowTpl=`submenuRows`!]



    Chunks :

    menuContainer

    <ul id="nav"[+wf.classes+]>[+wf.wrapper+]</ul>


    innerContainer

    <ul [+wf.classes+]>[+wf.wrapper+]</ul>


    submenuRows

    <li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+] </li>



    And include the 2 css files attached.


    Should work fine smiley


    Have fun !

    PS: wayfinder call and chunks for Modx Evolution.
      • 45769
      • 2 Posts
      Thank you so much for your reply. i am trying to implement this mega menu for simple HTML, is it possible ?
      i have tried by using above code in HTML, i am facing issues while configuring with HTML,it doesn't have any HTML markup .
        • 30672
        • 180 Posts
        you're on a modx forum smiley

        try this tutorial for simple html :

        http://designmodo.com/create-css3-mega-menu/
          • 28120
          • 380 Posts
          Actually I'm building a megamenu currently. Can't show you the site because it's on a protected development url but I'm using this http://www.webpulse.com.br/jet/demo.html and it's all working well with a couple of Wayfinder calls.

          Looking at the Goldman Sachs menu it's got some issues with it. The main one is that on a touch device touching a parent redirects you to the parent page so the megamenu is never revealed. This is bad! My rule is that parents can never be links but only used as a menu open. If you want content on a parent page you need to add a link to it in the megamenu (Symlink or Weblink)
            • 30672
            • 180 Posts
            hi Sparky !

            i would LOVE to see your modx code for a menu like this ! smiley

              • 28120
              • 380 Posts
              Hi troubadour, here's my code.

              <ul id="jetmenu" class="jetmenu blue"><li class="[[isActive? &id=`1`]]"><a href="[[++site_url]]">[[#1.pagetitle]]</a></li>
              <li class="[[isActive? &id=`2` &parent=`[[UltimateParent]]`]]"><a href="[[~2]]">[[#2.pagetitle]]</a>
                  <div class="megamenu full-width">
              		<div class="row">
                      [[Wayfinder? &startId=`2` &categoryFoldersTpl=`mainNavCatMega` &outerTpl=`mainNavOuterMega` &parentRowTpl=`mainNavParentMega` &levelClass=`megalevel` ]]
                      </div>
                  </div>
              </li>
              <li class="[[isActive? &id=`3` &parent=`[[UltimateParent]]`]]"><a href="[[~3]]">[[#3.pagetitle]]</a>
                  <div class="megamenu half-width">
                      <div class="row">
                          <img src="assets2/images-content/lights.jpg" alt="image" />
                          <p>And now for something completely different</p>
                          <p class=""><a href="[[~82]]">[[#82.pagetitle]]</a></p>
                          <p class=""><a href="[[~83]]">[[#83.pagetitle]]</a></p>
                          <p class=""><a href="[[~84]]">[[#84.pagetitle]]</a></p>
                      </div>
                  </div>
              </li>
              [[Wayfinder? &startId=`0` &excludeDocs=`1,2,3` &rowTpl=`mainNavRow` &outerTpl=`mainNavOuter` &innerTpl=`mainNavInner` ]]
              </ul>
              



              &categoryFoldersTpl=`mainNavCatMega` I used category rel="category" on containers that I wanted to be new columns

              <div class="col1 [[+wf.classnames]]">
              <ul>
                  <li class="[[+wf.classnames]]"><a href="[[+wf.link]]">[[+wf.linktext]]</a></li>
                  [[+wf.wrapper]]
                  </ul>
              </div>
              


              and &outerTpl=`mainNavOuterMega`

              [[+wf.wrapper]]


              and &parentRowTpl=`mainNavParentMega`

              <li class="[[+wf.classnames]]"><a href="[[+wf.link]]">[[+wf.linktext]]</a></li>
                  [[+wf.wrapper]]


              and I used a snippet isActive because I wanted to highlight if the top level button was active. Since I'm using multiple Wayfinder calls I can't get Wayfinder to do this for me

              <?php
              $output='';
              $thisID = $modx->resource->get('id');
              if(isset($id) && is_numeric($id) && $id == $thisID || isset($parent) && is_numeric($parent) && $parent == $id) {
                 $output='active'; 
              }
              return $output;


              and then for regular old dropdowns (single column not megamenu)

              &rowTpl=`mainNavRow`

              <li class="[[+wf.classnames]]"><a href="[[+wf.link]]">[[+wf.linktext]]</a>[[+wf.wrapper]]</li>


              &outerTpl=`mainNavOuter`

              [[+wf.wrapper]]


              &innerTpl=`mainNavInner`

              <ul class="dropdown [[+wf.classnames]]">[[+wf.wrapper]]</ul>


              and finally I'm using 4 levels in the tree per the attached and targeting css like

              .jetmenu li.megalevel2
                • 30672
                • 180 Posts
                thanks very much sparky !
                i will have a look at your code soon !