We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5429
    • 2 Posts
    Hi, just started using MODx and I am trying to use Wayfinder to create two different menus. The first menu is the main navigation that lists the main section pages in my site (About Us, Products, News, etc.) - the call I’m using for this, which works great, is:

    [[Wayfinder? &startId=`0` &level=`1`]]

    When the user visits a section, I would also like to have a menu that lists just the pages in that section. Each of my main section pages has pages underneath them in the document hierarchy and I am trying to figure out how to use Wayfinder to dynamically create a menu listing these section pages. I have looked at the documentation and searched for an example of this but have not been able to figure it out. Is anyone doing this on their site and could you possibly post the Wayfinder code that would create this dynamic section menu?

    Thanks,
    Clay
      • 36592
      • 970 Posts
      Check the UltimateParent snippet which is included in the MODx default install.
        • 5429
        • 2 Posts
        Quote from: tkfm at Apr 25, 2008, 01:08 AM

        Check the UltimateParent snippet which is included in the MODx default install.

        Thank you for pointing me to UltimateParent. For others who are trying to figure out how to create a section menu, I think the Wayfinder call is this:

        [!Wayfinder? &startId=[[UltimateParent? &topLevel=`2`]]!]

        Be sure and use the ’[! !]’ brackets instead of the ’[[ ]]’ brackets around the Wayfinder call. Evidently this is required when you are calling a snippet inside of another snippet (which you have to do with the UltimateParent snippet call).
          • 23571
          • 223 Posts
          "Be sure and use the ’[! !]’ brackets instead of the ’[[ ]]’ brackets around the Wayfinder call. Evidently this is required when you are calling a snippet inside of another snippet (which you have to do with the UltimateParent snippet call)."

          Thanks, a little tip like that can sidestep a lot of headaches.
            • 7231
            • 4,205 Posts
            [!Wayfinder? &startId=[[UltimateParent? &topLevel=`2`]]!]
            Actually the 100% correct way would be with the back ticks around the embeded snippet. With one parameter if may not be required, but it is a good practice to always use `` with a parameter value in a snippet call.

            [!Wayfinder? &startId=`[[UltimateParent? &topLevel=`2`]]`!]
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don't know what it is.
              Do you, Mr. Jones? - [bob dylan]