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

    I am pretty new to modx and I am trying to set up a modx website.
    I a struggling with a menu. Hope someone has an easy solution.
    My pages have a top menu with all level 0 pages.
    I want to have a submenu on the left with all the level 1 pages below the current level 0 page.
    To clarify:

    topmenu: toppage1 | toppage2 | toppage3

    If I am in a page below toplevel toppage1 (no matter how many levels deep!), I would need a left menu with:
    childpage1fromtop1
    childpage2fromtop1
    childpage3fromtop1
    ...

    Is this possible with 1 snippet on all pages (all levels deep)? Or do I need to create templates that call different snippets depending on how many levels deep the page is?
    Is this possible with the wayfinder snippet?

    Cheers.

    f.
      • 22427
      • 793 Posts
      Use the snippet "UltimateParent":
      http://modxcms.com/extras/package/?package=475
      (Sorry for being short - no time.)
        • 16278
        • 928 Posts
        Assuming your top-level documents are at root level, the Wayfinder/UltimateParent combination in your submenu will be:
        [!Wayfinder? &startId =`[[UltimateParent]]` &level=`1`!]

        NB: UltimateParent is part of the standard MODx 1.0.4 package
        - you need to have the Wayfinder call [!uncached!] and UP [[cached]] for the nested snippet to work properly.
        smiley KP






          • 9855
          • 7 Posts
          ok, thanks guys, Ottogals answer led me to http://wiki.modxcms.com/index.php/Snippet_call_anatomy where the code is mentioned that I think will do what I need.

          I have been messing around with this but it is not doing what it is supposed to do. I fear the reason is that I am using revolution. Could this be?
            • 16278
            • 928 Posts
            The tag syntax is certainly different from Evo: http://rtfm.modx.com/display/revolution20/Tag+Syntax
            rolleyes KP
              • 9855
              • 7 Posts
              i understand the difference in syntax, but no matter what i do i can only see the menu if I set the startid to 0.
              Changing this to 2 or 3 will return an empty result.
              I cannot manage to get child pages in a submenu

              My site is currently built like this:
              page 0
              \-- page 2
              \-- page 3

              i am using the code from http://muddydogpaws.com/development/wayfinder/examples/example-4.html