We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36686
    • 165 Posts
    I’m using MODX Revolution 2.1.1-pl (traditional) with Wayfinder 2.3.1, and I’m having a problem with &hideSubMenus.

    I want several menus on the same page, and at one point I actually got it working for one of the menus but not the others although they’re more or less identical, but now the exact same call won’t work with the first menu either...!

    The problem is when I add &hideSubMenus to the call(s). As soon as I add it, the whole menu disappears, not just the sub pages! I tried a range of different things, and it seems that &hideSubMenus=`0` doesn’t make the menu disappear, but when I add any of &hideSubMenus=`1`, &hideSubMenus=`TRUE`, &hideSubMenus=`true`, &hideSubMenus=`FALSE` or &hideSubMenus=`false` it does. Very odd.

    Logically, this should display the top level pages in the folders 208 and 209, and when one of those pages are active the sub pages should show, right?

    [[Wayfinder? &startId=`208` &level=`0` &hideSubMenus=`TRUE`]]
    [[Wayfinder? &startId=`209` &level=`0` &hideSubMenus=`TRUE`]]


    I also tried calling Wayfinder uncached and also clearing the cache, but it doesn’t make any difference.

    This is doing my head in, and my client is getting annoyed, so any help would be much appreciated!
      • 22427
      • 793 Posts
      Firstly, before I take a nearer look:
      Against some saying in various documentations, the values of Boolean parameters in snippets always should be [tt]`0`[/tt] or [tt]`1`[/tt] .
      [tt]&hideSubMenus[/tt] and some others are interpreting only `0` as false, all the others (`1`, `TRUE`, `true`, `FALSE` !!, `false` !!) as true.
        • 22427
        • 793 Posts
        [[Wayfinder? &startId=`208` &level=`0` &hideSubMenus=`1`]]
        [[Wayfinder? &startId=`209` &level=`0` &hideSubMenus=`1`]]

        If you are on a subpage of 208, say 333, the first WF call will show the subpages of this page 333 (only 1 level deep) - but not the page 333 itself. The second WF call instead will show nothing.

        If you are on a subpage of 209, it’s just the opposite: the first WF call will show nothing, but the second WF call will show the subpages of the page you are on, 1 level deep.

        BTW: Did you also try [tt]&startId=`[[*id]]`[/tt] ?
          • 36686
          • 165 Posts
          Oh ok, I think I see what the problem is now. I guess I’ll have to try to use just the one call for the whole navigation and split it up by the use of categories:

          [[Wayfinder? &startId=`72` &level=`3` &hideSubMenus=`0` &categoryFoldersTpl=`wayfinderCategoryFoldersTpl` ]]


          The problem then is to show the category plus one level of navigation, and show any further levels just when that section is active... So I want to hide level 3 onwards basically... Is that possible?
            • 22427
            • 793 Posts
            To be sure to understand what you mean: Please show the essential part of your resources tree and give examples for the wanted WF output on certain pages.
              • 36686
              • 165 Posts
              I solved it using some css:

              #navigation ul ul ul { display: none; }
              #navigation ul ul li.active ul { display: block; }