We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 49866
    • 4 Posts
    Is it possible to use wayfinder in a way to create submenu's with memory?

    Example:

    - Startpage 1
    -subpage 1
    -subpage 2

    Then if subpage 2 is clicked the page tree should remain and the subpage 2 link should be highlighted. Is this possible from within one template and with one wayfinder call?

    I want to create a template with this menu/submenu structure and use it on many different pages, but i can't seem to grasp how I should set this up, if at all possible.

    Thanks in advance!


      • 22427
      • 793 Posts
      Call the snippet like
      [[Wayfinder? &startId=`0` &selfClass=`highlight`]]
      and define the class in your CSS:
      li.highlight {color: #f00}
      or whatever you like.
        • 46309
        • 79 Posts
        You can use Ultimate Parent - http://modx.com/extras/package/ultimateparent, to remain the page tree.
        Something like that:
        [[Wayfinder? &startId=`[[UltimateParent? &topLevel=`2`]]` &selfClass=`highlight`]]
          peace&love / bike&ride
          • 49866
          • 4 Posts
          Thanks for your answers.

          I just found out about Ultimate parent en tried to implement it.

          If I have this document tree:

          rootpage
          --subpage 1
          --subpage 1
          ---subpage 2
          ---subpage 2

          and call wayfinder on subpage 2 it only shows subpage 1 and subpage 2 in the menu, not the rootpage.

          This is my call:
          [[Wayfinder? &startId=`[[UltimateParent? &topLevel=`2`]]` &selfClass=`highlight`]]


          It only shows

          --subpage 1
          ---subpage 2
          ---subpage 2
            • 46309
            • 79 Posts
            Sorry, didn't understood you correctly.

            Then you have to remove the Ultimate Parent and make it like ottogal wrote you:
            [[Wayfinder? &startId=`0` &selfClass=`highlight`]]


            This will brings you all the menus and submenus.
              peace&love / bike&ride
              • 49866
              • 4 Posts
              Indeed, I wil get all the menus, but also all menu's that I don't want to show because there are multiple rootpages


              For example:

              rootpage1
              rootpage2
              --subpage1
              --subpage2
              ---subsubpage1
              ---subsubpage2
              rootpage3

              When i'm at subsubpage2 i get all rootpages with all submenu's etc. A very long list.

              I just want to show:
              rootpage2
              --subpage1
              ---subsubpage1
              ---subsubpage2
              --subpage2
              --subpage3

              I have an example attached...sorry if i'm making it more difficult than i should be...
                • 46309
                • 79 Posts
                Why not trying to play with the css and show the active submenus with .highlight and use display: none; or visibility: hidden; for the rest of the inactive submenus.
                  peace&love / bike&ride
                  • 22427
                  • 793 Posts
                  You can try
                  [[Wayfinder? &startId=`0` &selfClass=`highlight` &hideSubMenus=`1`]]
                  This will show only the submenus of the actual rootpage and hide the submenus of the others. (But these other rootpages themselves will be shown - for a good reason: otherwise you wouldn't call it a navigation any more...)