We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17723
    • 221 Posts
    Hello,
    I just wonder is it a proper way "hidesubmenus" behavior in Revo 2.0.4 (and Wayfinder 2.1.3)

    In my template I have this call:
    [[Wayfinder? &startId=`32` &hideSubMenus=`1` &rowIdPrefix=`nav`]]
    To list always all products, but does not show submenus for product description, tech spec, ect. That works fine.

    But when I display any other document that is not child of id=32, my menu disappears. I don’t think this is the way hidesubmenus was intended to work ... or I don’t understand something huh

    If this is how it should work, than what is the popper way to have all of my products listed in my template, but have a product submenu listed only when i go to it?

    Luke
      Lucas from AroundCyprus.net
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      startId will use that document as the "parent" from which to create the menu. Nothing besides children of that parent will be in the menu.

      hideSubMenus means that third-level branches won’t show until you have navigated to one of the pages in the menu.
        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
        • 17723
        • 221 Posts
        So there is a bug !

        It doesn’t work like You explained it.

        The menu with children of parent document disappears when navigated to any other section of my website that is not in parent folder.

        luke

          Lucas from AroundCyprus.net
          • 17723
          • 221 Posts
          In my case hidesubmenus - hides third-level branches, which is OK, but as well disappears immediate child menu items when navigated to pages that are not in 32 parent folder - and this is NOT OK.
            Lucas from AroundCyprus.net
            • 27705
            • 38 Posts
            I was running into this same problem and ended up just making a small modification to the wayfinder.class.php to fix it.

            At line 186 in the code you’ll see
            if ((!$this->_config['hideSubMenus'] || $this->isHere($parentId) || $parentId == 0)) {


            change $parentId == 0 to whatever parentId you want your menu to start at.

            I’m assuming for future fixes this variable should refer to the startId number, unless I’m just missing the point of hideSubMenus.