We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25772
    • 35 Posts
    Is it possible, in Wayfinder, to use a different chunk for top-folders with more than one child to those with with only one?

    My top-level folders are just that - folders (template blank). I would like the folders with only one child to be be a link (to the child), while those with more to be a heading. (My headings expand and contract using a simple javascript toggle, but it seems a bit silly to have a heading expand for only one menu item.)

    If this is possible, how?

    Thanks in advance.
      • 15987
      • 786 Posts
      It is not possible to template wayfinder this way. however what you could do is to use the first child redirect snippet in the folder document and set the child to not show in menu. then when someone clicks on the folder it takes them to the child doc.
        • 25772
        • 35 Posts
        I have tried this. However, I would like to be able to format this link differently to those styled by &rowTpl. I’ve used &categoryFoldersTpl for the other headings and had hoped to use &parentRowTpl for this link, but as there are no children displayed in the menu, it uses &rowTpl. I then tried having the page displayed in the menu and hiding it with css, but have decided it’s all getting too complicated.

        I think I’ll just turn off the menu for the home page and display it manually before the Wayfinder call.

        Thanks for your help.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Indeed, it can be a trap to begin to think that we have to use snippets and such for everything; sometimes a simple hard-coded menu for a part of the site that won’t change is all that’s needed! Not only saves fussing with templates and snippet configurations, it also saves the parsing time needed to evaluate the (really unnecessary ) snippet code!
            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