We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28907
    • 16 Posts
    Hello everybody!
    Thanks for a great community - I have already studied a lot of threads and learned a lot!

    Now I’m making af menu with Wayfinder 2.0, but it won’t work.
    I want it to show the parents horizontically and the children of the active parent vertically in a menu.

    Parent 1 | Parent 2 | Parent 3 | etc.

    Child 2_1
    Child 2_2
    etc.

    How can this be done?
      • 9130
      • 171 Posts
      There is more then one way to do this.
      One options is with two separate wayfinder calls. Have one wayfinder snippet always display the top menu items and have another one display the children of the current document (or the children of the current document’s parent depending on the exact site structure).
      Another option would be to have the wayfinder snippet always create the html for all the children of all the documents and use css rules show only the ones that are decedents of the ’active’ document class, obviously this could be inefficient if you have lots of menu items and children.
        • 25663 MODX Staff
        • 12,272 Posts
        It’s not clear if that’s a split menu or if that’s a dropdown.
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 28907
          • 16 Posts
          @ rthrash: It is not a dropdown menu... So I guess it is a split menu... Like traditional webdesign - there is a sidebar with the children/submenus...
          @ etal: I think I will use your option one with two different Wayfinder calls... In fact this is what I already tried, but although I figured out how to only show the parents, I couldn’t figure out how to only show children.
          I tried
          [[Wayfinder? &startId=`0`&level=`1`&outerClass=`nav`&innerClass=`subnav`]]

          for the parents, but what should I write to make Wayfinder only show children?
          I cant get
          [[Wayfinder? &startId=`2`&level=`0`&outerClass=`nav`&innerClass=`subnav`]]
          to work...
            • 9130
            • 171 Posts
            Quote from: superstoffer at Apr 03, 2009, 01:51 AM

            what should I write to make Wayfinder only show children?
            I cant get
            [[Wayfinder? &startId=`2`&level=`0`&outerClass=`nav`&innerClass=`subnav`]]
            to work...
            Whats the problem with this Wayfinder call? What is it showing?

            Since each of the parent pages needs to show a different child menu and I assume this menu should also appear on the child pages themselves the solution is to add another snippet to the mix, the UltimateParent snippet, like this:
            [!Wayfinder? &startId=`[[UltimateParent]]` &level=`1` &outerClass=`nav` &innerClass=`subnav`!]
            

            Note the exclamation marks on the snippet call and you need to set up the document tree to match the menu structure.
              • 28907
              • 16 Posts
              It is showing nothing...  :(
              I’m not quite sure how this UltimateParent works...

              It it really so hard just to show only children in Wayfinder?  :)

              edit: typo
                • 20413
                • 2,877 Posts
                Dowload this http://modxcms.com/forums/index.php?action=dlattach;topic=34176.0;attach=9315 [zip book]
                And visit http://www.muddydogpaws.com/development/wayfinder/examples.html  smiley

                //Try &startId=`0` &level=`3` to see 3 levels from root
                  @hawproductions | http://mrhaw.com/

                  Infograph: MODX Advanced Install in 7 steps:
                  http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                  Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                  http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                  • 30564
                  • 60 Posts
                  Couple of thoughts

                  1. Ensure the snippet is spaced out eg: [!Wayfinder?&startId... will not work [!Wayfinder? &startId... will. This seems to be true for all variables, so check there’s a space after each closing back tick.
                  2. Ensure all your variable calls are correctly Camel Cased e.g. startId not startid or startID
                  3. Ensure all are back ticked
                  4. Try just the Wayfinder call with no variables, what do you get?
                  5. Put [[UltimateParent]] into the page on its own, what do you get?

                  One last point, surly you should be identifying these as 2 different menus? Presumably the menu CSS will need to differentiate between the horizontal & the vertical page menu?

                  Regards
                  PS Yes these have all been learned the traditional way.... rolleyes
                  PPS I’m presuming you’re looking to do something like the product section www.fieldandtrackinternational.com
                    • 28907
                    • 16 Posts
                    I managed to work it out with the UltimateParent-snippet...

                    Thank you all for your tips and links!
                      • 34108
                      • 66 Posts
                      Had this exact same problem recently, found this thread at the top of a Google search but no solution was posted (argh!). So thought I should post mine which I found by using just CSS (thanks to your idea Etal of displaying only the children of the active parent item).

                      The Wayfinder call

                      <div id="main-nav">
                      [!Wayfinder? &startId=`[[UltimateParent]]` &level=`2` !]
                      </div>
                      



                      The CSS

                      /* Show children of active parent only */
                      #main-nav>ul>li>ul { display: none; }
                      #main-nav>ul>li.active>ul { display: block; }