We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7484
    • 12 Posts
    Hey there
    I’m new on MODX and I would like to ask if somebody can explain me how to setup a Submenu Navigation.

    I have on the left only the Mainmenu like this:

    - Menu 1
    - Menu 2
    - Menu 3
    - Menu 4
    - Menu 5


    On the top of every page, I would like to implement all the submenus like this:

    top of Page1 (Menu1)
    Submenu 1 of Menu1 | Submenu 2 of Menu1 | Submenu 3 of Menu1 | Submenu 4 of Menu1


    Hope this makes sense. Im strugling to make this run.

    Any help appreciated!

      • 25260
      • 156 Posts
      I’m sorry but I can’t understand what you want to do!

      Can you explain it better?
        • 7484
        • 12 Posts
        Ok, let’s look at this example...


        I have a menu navigation like this:
        - Main Menu 1
        |- Submenu 1
        |- Submenu 2
        |- Submenu 3
        |- Submenu 4
        |- Submenu 5
        - Main Menu 2
        |- Submenu 1
        |- Submenu 2
        |- Submenu 3
        - Main Menu 3
        |- Submenu 1
        |- Submenu 2
        


        On the main navigation on the left side, I only want to display the Main Menus. And then, when I click one of the Mainmenus, the respective page opens up. Then, on the top of that page (above the content), I would like to display the submenus.

        So if I click "Main Menu 1" on the left, the respective page opens, and on the top of that page, the following menu should be displayed:

        | Submenu 1 | Submenu 2 | Submenu 3 | Submenu 4 | Submenu 5



        makes sense?
          • 16278
          • 928 Posts
          Have a look at Susan Ottwell’s MODx From the Inside site concerning Template Variables. The subsection on Using Checkboxes to Control Sidebar Content Blocks on the Input Types pages looks like what you are after (you just want your sub-menus at the top rather than in a sidebar, I think).  smiley KP
            • 25260
            • 156 Posts
            We have the same thing with those 2 menus inverted laugh

            It’s 2 Wayfinder calls:

            The first, for your leftside menus:

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

            and here the second, for the upper one:

            [!Wayfinder? &startId=[[UltimateParent]] &hideSubMenus=`TRUE`!]

            We needed a kind of conditional behavior for generating the 2nd menus, so I wrote a little snippet to achieve that.

            I don’t know yours, just keep asking smiley
              • 7484
              • 12 Posts
              Ok, I’m getting close to the solution:

              My wayfinder call looks like this now, and the submenues are displayed! Thanks for your help for now!

              [!Wayfinder? &startId=`[[UltimateParent]]` &hideSubMenus=`TRUE` &outerClass=`testclass`!]<br />
              


              Only had to add the "`" around [[UltimateParent]] call....
              cheers!
                • 25260
                • 156 Posts
                yes, my mistake, I forgot them writing here smiley
                  • 5689
                  • 289 Posts
                  Roberto, unless I missed it, would you mind sharing your code for the snippet? I found this topic because I’m trying to achieve almost the exact same thing. I’m good with PHP, but I’m new to MODx, and it’d be great if you’d be willing to share the code for your snippet to find the Ultimate Parent. Thanks!
                    I&#39;m learning more about MODx all the time and loving it.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    The UltimateParent snippet should be part of your default MODx installation.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 5689
                      • 289 Posts
                      Yeah, sorry, I totally just realized that. I also found it via Google anyway. smiley
                        I&#39;m learning more about MODx all the time and loving it.