We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10208 ☆ A M B ☆
    • 1,780 Posts
    I find this strange... yet this is the second installation that this has happened with.

    I've got a simple Wayfinder call with &hideSubmenus=`yes` that works fine on parent and root level documents. But not in child documents, it works, but the submenus show up.

    There is only one call, in the footer chunk within the template. Parents and children use the same template.

    When I change the child document into a root document, the menu works as expected. As soon as I give it a parent, again the submenus show up.

    OK, here ya go... some really complex Wayfinder code for y'all to verify:
    [[Wayfinder? &startId=`0` &rowTpl=`rowTpl` &hideSubMenus=`yes`]]


    Seriously, what's wrong with that? All I'm looking for are links back to the main pages. Nothing special, just text.


    Revo 2.2.0-pl2


    [ed. note: frogabog last edited this post 14 years, 7 months ago.]
      Frogabog- MODX Websites in Portland Oregon
      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
      Having server issues? These guys have MODX Hosting perfected - SkyToaster
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Usually it's best to use 1 or 0 instead of yes or no or even true and false, although I'm not sure it will make a difference in your case, although it's working fine for me at all levels.

      I did have a moment's confusion because I happened to be on the parent page in question when adding child pages to it, and of course the submenu was showing.

        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
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        Thank you Susan, I'll keep that in mind from now on.

        OK, so I changed the yes to 1. Nothing changed in the output, just as you suspected.

        I think I'll try adding some more classes to see if it ignores them too. The only consistent variable is parent vs child. I can drag it in the tree from parent to child, that's when the submenus show up. I can't drag it to root from child, but I can change the settings and it reloads into a root slot in the tree. Then the menu has no subs, working fine. Drag it back to child, there they are again.

        Any other ideas are always welcome.
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 10208 ☆ A M B ☆
          • 1,780 Posts
          &level=`1` added, which worked. But I'd expect that to work, as it's intent is to constrain.

          Still doesn't explain why &hideSubMenus is broken on child pages. &parentClass (or lack thereof) wouldn't have anything to do with this would it?
            Frogabog- MODX Websites in Portland Oregon
            "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
            Having server issues? These guys have MODX Hosting perfected - SkyToaster
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            I just used a very plain Wayfinder call with no tpls, just the startId and hideSubMenu parameters. I have the levels going three levels deep from the root level (four levels in all), and it makes no difference how I arrange the levels. It just works. This is with 2.2.1 and a new installation of the Wayfinder package.
              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
              • 22427
              • 793 Posts
              I think there is a misunderstanding about the meaning of &hideSubMenus=`1`.
              It does not mean that all the submenus will be hidden.
              The submenu of the actual page will be displayed (but only one level deep) - just all the others will be hidden.

                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Ah. That would certainly explain what's going on.

                The hideSubMenus parameter will remove all non-active submenus from the Wayfinder output if set to TRUE. This parameter only works if multiple levels are being displayed.
                  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
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Ah. That would certainly explain what's going on.

                  The hideSubMenus parameter will remove all non-active submenus from the Wayfinder output if set to TRUE. This parameter only works if multiple levels are being displayed.
                    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
                    • 10208 ☆ A M B ☆
                    • 1,780 Posts
                    I read that in The Official Guide while looking for a class to add actually and wondered if it was was causing it. Looks like yes, that was the problem. Because when I take out the &level class, the parent page does indeed show submenus just like the children.

                    So, to restrict submenus on pages with children and the child pages, &level=`1` must be used in addition to &hideSubMenus=`1`.

                    Or just use &level=`1` without &hideSubMenus. That seems to work just fine.
                      Frogabog- MODX Websites in Portland Oregon
                      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                      Having server issues? These guys have MODX Hosting perfected - SkyToaster