We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30537
    • 9 Posts
    I want to build a MODx site with 3 levels of navigation. Users can make a main section choice, and then within each section There will be several categories, and depending on which category is being viewed, several subpage links will be displayed.

    It would look something like this:


    What is the best way to go about this using MODx? It may turn out that the top-level (sections) are hard-coded, but then how do I handle the 2 level navigation, I want only links relating to the active category to be displayed. Is it possible to do this dynamically using folders/dropmenu or similar?

    Thanks for your help and let me know if this is unclear.
      • 11975
      • 2,542 Posts
      Hi,

      For instance your tree repository could be like this one
      /root
      --|section 1(folder/container)
      ---|category 1(folder/container)
      ------page1
      ------page2
      ---|category 2(folder/container)
      ------page1
      ------page2
      --|section 2(folder/container)
      ---|category 1(folder/container)
      ------page1
      ------page2
      ---|category 2(folder/container)
      ------page1
      ------page2
      --|section 3(folder/container)
      ---|category 1(folder/container)
      ---|category 2(folder/container)

      To make the main navigation
      [[wayfinder? &startId=`0` &level=1]]
      will display Section1|Section2|Section3

      To build the navigation of the current Section
      [!wayfinder? &startID=`[[UltimateParent]]` &hideSubMenus=`1` &level=`2`!]

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 30537
        • 9 Posts
        ah, quite easy!

        I appreciate your help!
          • 11975
          • 2,542 Posts
          You’re welcome.

          I’m sorry not to give you more explanation but english is not my mother tongue.
          I advice you to have a look to wayfinder doc.
          UltimateParent returns the highest parent in the tree which is not the root (equal to 0)

          :-)
            Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
            • 30537
            • 9 Posts
            Thanks, I’ll be able to figure it out from here. I’m playing with wayfinder now.
              • 30537
              • 9 Posts
              can someone explain the [[UltimateParent]] part?

              Does that only work with wayfinder? I can’t seem to find any documentation on it.
                • 30537
                • 9 Posts
                well i found the documentation for ultimate parent tongue

                does anyone have a suggestion for finding the parent of the current level, not hte ULTIMATE parent


                like:

                folder1
                -subfolder
                -subfolder
                --page
                --page2
                -subfolder

                folder1
                -subfolder
                --page

                if i am on a page, how can i reference the id of its subfolder?
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  [*parent*]
                    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
                    • 30537
                    • 9 Posts
                    im such a newbie! wink

                    thanks
                      • 30537
                      • 9 Posts
                      can you get the parent of a parent?

                      some variant of [*parent*] ?