We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10666
    • 68 Posts
    Firstly, I’d like to say congratulations for such a nice snippet grin .

    Now,to explain the issue I’m facing.I have a menu that looks like this:
    Item1
    |   Item1.1
    |   Item1.1
    |   Item1.2
    Item2
    |   Item2.1
    |   Item2.1
    |   Item2.2
    Item3
    |   Item3.1
    |   Item3.1
    |   Item3.2
    

    And I would like for wayfinder to output just this:
    Item1
    Item2
    |   Item2.1
    |   Item2.1
    |   Item2.2
    Item3
    

    Actually,the menu is much bigger and nested , but I hopes this suffices for explaining my problem.
    I was thinking that having the possibility to have multiple startIDs would solve this. (I would call wayfinder with startID’s of Item1 and Item2 , and level=1).
    That , or a filtering system based on IDs would also work.

    Any ideas on what to do atm ? [multiple wayfinder calls are not what I’d call a manageable solution - especially considering the fact that my menus have a lot more items that what I have drawn ].

    I know ditto has multiple start IDs implemented , so maybe some code may be shared between the projects.(ditto will also sport filtering,but based on TVs ,not IDs ).
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Is it that you want the submenu to show only when you are in a page in that subemnu’s area? If that is the case, you can use &hideSubMenus; this will only show the submenu of the active link.
        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
        • 10666
        • 68 Posts
        No,that wasn’t what I was looking for sad .
        I want to show it that way even in pages that are in an other submenu area.
        I solution I’ve found is to put a intermediate container(not shown in the menu) between Item1 and it’s subitems,and do the same for Item3 and it’s subitems, but that’s not a very good solution I’m afraid embarrassed .
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Well, using a database query and displaying the output nicely is how Wayfinder behaves, and this does not lend itself to asymmetrical behavior (i.e. each return from the database is handled in the same way, as part of a loop).

          However, you can give each section its own ID, then simply hide the ones you don’t want displayed in the CSS.
            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
            • 10666
            • 68 Posts
            Though that means (much) bigger code size than expected and pretty bad SEO ( search engines don’t usually like hidden/cloaked text very much ). Also , it would mean my source code would contain the same menu(and a damn big one) for a quite large amount of pages , and , combined with cloaking certainly won’t do me any good.
            After all , this is a SEO CMS , right ? grin