We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    I apologize, but I can’t find any docs on using wayfinder to do mulitple menus the way I would like to. Here’s my goal:
    I have a horizontal top navigation run by wayfinder each menu item is a container with subpages. As you mouse over the menu a submenu appears. What I’d like to do is when the main level item or submenu item of a specific item is clicked that a vertical menu shows up with the options that were in the submenu of the horizontal nav. Like so:

    Horizontal Top Navbar:
    Home
    Services
    --Service 1
    --Service 2
    --Service 3
    About
    Contact

    Vertical Side Nav:
    Service 1
    Service 2
    Service 3

    So, when they click on Services or any one of the sub menu items the left nav appears with those options. Thanks.

      The MODx has you...
      Utah Web Design
      • 19943
      • 14 Posts
      I’m doing that and here’s the call I’m using:

      [!Wayfinder? &startId=`[[UltimateParent? &topLevel=`1`]]` &hideSubMenus=`0` &outerTpl=`cteSide_wfOuter` &rowTpl=`cteSide_wfRow` &innerTpl=`cteSide_wfInner` &innerRowTpl=`cteSide_wfInnerRow` &hereClass=`active` &lastClass=`last`!]


      It works great for me. It’s the UltimateParent call that does the magic.

      And remember that this is the second Wayfinder call. You need one at the top and one for the separate menu.

      What I’m working on now is trying to figure out how, on the top menu, to keep the active state on the top-level page when I am on one of the submenu pages. Anyone have that figured out?
        • 4749
        • 623 Posts
        Thanks, I’ll give that a try. I really wish I could help on your other problem, but sadly enough I’m not very adept at these things. But, I really appreciate your reply. I’ll let you know if I find a solution to keep the main nav button active.
          The MODx has you...
          Utah Web Design
          • 9496
          • 113 Posts
          You can accomplish the active state via css. For instance, if you have Category 1 as the main page, give it the body id of "mainpage". Then if you have a subsection page give that the same body ID. Then if you want the subsection link in your secondary menu you can give that a specific ID as well will will trigger whatever style you place on that.

          So You have a main menu
          <ul>
          <li class="category1linky"> category1</li>
          <li class="category2linky"> category2</li>
          </ul>

          And then your secondary menu
          <ul>
          <li class="category1sublinka"> category1:sublinkA</li>
          <li class="category1sublinkB"> category1:sublinkB</li>
          </ul>

          And the css would be something like:

          body#category1 li.category1linky, body#category1 li.categorysublink a {style:here;} This would trigger the category1 link style from the main nav as well as the category sublink style.

          -P
            • 4749
            • 623 Posts
            OK, that’s working...mostly. I guess what I’m looking for is a way to get the heading of the secondary menu to display the active main menu name. For example, if I’m in the about section and clicked on Item 1 I want the Sub menu to have an <h2> tag for About and then list the submenu items below.

            Main Menu
            Home
            Services
            About
            Contact

            Side Menu
            About
            -Item 1
            - Item 2

            Does this make sense? I just want the top level menu name to appear as the Header for side menu.

            Thanks.
              The MODx has you...
              Utah Web Design
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              &displayStart=`1` is what you’re looking for. The &startItemTpl=`chunkName` will let you use a chunk for a template for it.
                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
                • 4749
                • 623 Posts
                Brilliant Sottwell, I was just looking at that. Now you’ve confirmed it for me. Thanks so much.

                Update: Sottwell, it’s almost working like I wanted it to. Except it’s leaving the <h2></h2> tag empty. It’s showing up in the code, but the [+linktext+] parameter isn’t filling in the main menu item as the header. Any thoughts?

                here’s a link to the development site: http://www.usc-dev.com/about.html you’ll see the left hand menu that I want to have a heading on, but its not there?

                Thanks again.
                  The MODx has you...
                  Utah Web Design
                  • 9496
                  • 113 Posts
                  I noticed that your closing </h2> tag is coming up <h2/> when using Firebug. That may be the cause of it not rendering.
                    • 4749
                    • 623 Posts
                    well, it looks right in the code for me when I view source and in Firebug. Weird. Thanks for looking though. Oh, maybe I should have put this up to begin with:
                    [!Wayfinder? &startId=`[[UltimateParent? &id=`[*id*]` &topLevel=`1`]]` &hideSubMenus=`0` &outerTpl=`sub_wfOuter` &rowTpl=`sub_wfRow` &hereClass=`active` &displayStart=`1` &startItemTpl=`subHeader` !]


                      The MODx has you...
                      Utah Web Design
                      • 4749
                      • 623 Posts
                      Still no joy. I can’t figure out. I would just like to get the Main menu item to become the <h2> of the left sub menu. Any other thoughts?
                        The MODx has you...
                        Utah Web Design