We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31902
    • 342 Posts
    I have a site with two menus. The menu along the top of the site has some top-level pages and don't have any submenu items associated with them. In the resources tree, they are created at the top level.

    On the left side of the site, there is another menu with submenus that appear when you click on them (not a flyout setup...more of an accordion kind of behavior on a click basis).

    The side menu is structured as a container inside of a container inside a container and a resource inside the final container. So, it looks kind of like:

    outer container

    >container A
    >> container 1
    >>> resource a
    >>> resource b
    >> container 2
    >>>resource c
    >>>resource d

    > container B
    >>container 3
    >>> resource e

    ...you get the picture.

    What I want to do is to have the lower level resources or containers show up only when I click the parent right above it...not to have all the children appear within a container.

    When I use a Wayfinder call for the left column menu that looks like this:

    <div id="navigation-left-col">
    [[Wayfinder? &startId=`8` &outerTpl=`menuContainer` &level=`4` &hideSubMenus=`1` &firstClass=`` &lastClass=`` &selfClass=`self`]]
    </div><!--navigation-left-col -->


    ...it works great. The problem is that when I then visit a page that is on the top level menu (such as the home page), the left column menu disappears. My top level menu Wayfinder call looks simply like this:

    [[Wayfinder? &startId=`0`]]


    If I change the side menu's Wayfinder call to have this &hideSubMenus=`0`, all menus appear, but all the children of the left column container appear (starting on level 2).

    Not sure if it matters, the menuContainer tpl mentioned above contains this:

    <ul[[+wf.classes]]>[[+wf.wrapper]]</ul>


    Any way around this? Thank you in advance.

    MODx 2.1.3
    PHP Version 5.2.10
    [ed. note: waizen last edited this post 14 years, 9 months ago.]
      • 3109 ☆ A M B ☆
      • 894 Posts
      Easiest way to achieve this is via CSS and JS/jQuery not through wayfinder IMHO.

      If you post a live link it would be easier to help.
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 22427
        • 793 Posts
        The problem is that when I then visit a page that is on the top level menu (such as the home page), the left column menu disappears.
        It seems that you have different templates for your top-level pages and the subpages.
        Are you sure to have set the Wayfinder call for the left column menu also in the template for the top-level pages?
        (I'm sure that JS/jQuery is not necessary to solve this problem.)
          • 31902
          • 342 Posts
          Thanks, guys.

          The calls are the same for every page. Although I have multiple templates, they are all being fed by the same chunks.

          Really, the thing works great as long as the side menu uses &hideSubMenus=`1` within its call. It's just that the top-level pages (the ones that live outside of the left menu container in the resources tree) don't show the left menu when you visit them. As soon as I set &hideSubMenus=`0` in the side menu Wayfinder call, the menus on all pages come back.

          Again, thanks for responding. [ed. note: waizen last edited this post 14 years, 9 months ago.]
            • 22427
            • 793 Posts
            If you don't have a live link, could you show us the resources tree (with id's)?
              • 31902
              • 342 Posts
              Thank you for responding, ottogal. Attached is a screenshot of the resources tree. Hopefully, it is self-explanatory (look for the 'Left Column Menu Pages' container which contains the menu in the left column).
                • 22427
                • 793 Posts
                The resource Left Column Menu Pages is greyed out in the tree, that means you ticked the option Hide From Menus. As a consequence, all its children are hidden from the menu too (despite their Hide From Menus property is unchecked).

                Really, the thing works great as long as the side menu uses &hideSubMenus=`1` within its call. It's just that the top-level pages (the ones that live outside of the left menu container in the resources tree) don't show the left menu when you visit them. As soon as I set &hideSubMenus=`0` in the side menu Wayfinder call, the menus on all pages come back.
                That's how &hideSubMenus=`1` works. Having this in a resource outside of the left menu container, it will not display any of the resources inside it. [ed. note: ottogal last edited this post 14 years, 9 months ago.]
                  • 22427
                  • 793 Posts
                  To solve your problem, try the following:

                  Uncheck the Hide From Menus option of your resource #8 (Left Column Menu Pages).

                  Modify the top level menu Wayfinder call to exclude this resource from the output:
                  [[Wayfinder? &startId=`0` &excludeDocs=`8`]]
                    • 31902
                    • 342 Posts
                    Thank you, ottogal, for sticking with me here; I appreciate your help. Unfortunately, your suggestion didn't have an effect. I did uncheck the Hide From Menus option (didn't mean to have that checked to begin with), added the &excludeDocs=`8` and tried the left column menu with, both, &hideSubMenus=`1` and &hideSubMenus=`0`. No difference.

                    I know you know what I mean by what I'm trying to accomplish, but now that I've started uploading screenshots, I might as well upload these:

                    The screenshot marked 'wanted.jpg' shows what I'm trying to accomplish. I did that by adding &hideSubMenus=`1` to the left column menu Wayfinder call. When I click on 'Recreation' only the seasons show up. Then, when I click on 'Summer' (like in this image) only the Summer activities show up. The others stay closed.

                    The screenshot marked 'unwanted.jpg' shows what happens when adding &hideSubMenus=`0` to the Wayfinder call. When I click on the 'Recreation' page, all the submenu items appear. Would not be such a bad thing but from the image, you can see how long it will end up appearing. Not the greatest look in this case.

                    Also, while the left column Wayfinder call has &hideSubMenus=`1`, when I click on one of the top of the page menu items, the left column menu goes away, like the screenshot called 'gone.jpg'. In this image, the menu should be showing above the 'Image Tour' button within the left column. But, it's gone.

                    Again, thanks for your help. [ed. note: waizen last edited this post 14 years, 9 months ago.]
                      • 3109 ☆ A M B ☆
                      • 894 Posts
                      Again, what you want to accomplish has to be done with css and javascript/jQuery.

                      If I understand correctly you want to achieve something similar to this if thats the case you need to look for a Nested List Accordion Menu Wayfinder does not create this functionality for you all Wayfinder does is generate the navigation.

                      Hope that points you in the right direction wink
                        Benjamin Marte
                        Interactive Media Developer
                        Follow Me on Twitter | Visit my site | Learn MODX