We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38357
    • 178 Posts
    Hello,
    I'm relalively new to Modx and having a small problem with Wayfinder. I have searched but am unable to find a solution I understand - perhaps someone can point me in the right direction.
    My Wayfinder menu works fine except that the displayed links which have dropdown links also display a page when clicked. What I want is to have the link react onmouseover but only with the dropdown - not displaying the underlying page when the item is clicked. If the page is published it shows in the menu , but how do I prevent it showing the page when clicked?

    Probably simple, but I just can't find the answer :-(
    • You need to use a custom tpl for category folders:

      &categoryFoldersTpl
      Name of the chunk containing the template for category folders. Category folders are determined by setting the template to blank or by setting the link attributes field to
      rel="category"
        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
        • 38357
        • 178 Posts
        Thanks for ypur help Susan. I have been following your excellent tutorials, without which I would never have attempted Modx. Your efforts are greatly appreciated.

        When I set the template of a category page to '0' ie no template, when I click the menu item I get a blank white page. Is this the default behavior or have I missd something? If so is there any way to have the page stay as it was so that if the user clicks on the menu item rather than a link in the dropdown, there is no change to the page?

        Thanks for your assistance.
        • That is just one way of defining a "category" resource to Wayfinder. You also need to have the &categoryFoldersTpl set to a custom tpl which would not have a URL. If you don't specify the custom tpl it'll just use the usual rowTpl and make a link out of it.

          Your categoryFoldersTpl will need to be almost exactly like the rowTpl you're using for the rest of that top level menu, only it won't specify a link. This may take a bit of thought, as there won't be an A tag for styling. Don't forget the wf.wrapper placeholder to generate the inner rows of the menu. [ed. note: sottwell last edited this post 12 years, 3 months ago.]
            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
            • 38357
            • 178 Posts
            Thanks again Susan.
            With a bit of fiddling I think have it resolved. I found that I didn't need to remove the A tag but just not have [[+wf.link]] in the 'href=" " ' leaving it blank.

            Seems to work OK.

            It's a rather steep learning curve at the moment smiley
              • 38357
              • 178 Posts
              Oops - the forum removed the code:
              not have anything in the 'href=" " '
              • The trick to using Wayfinder (and all of the listing snippets, such as getResources and getPage) is to step back and consider the final HTML structure you want, then use their output tpls to generate that structure. That, of course, means studying the documentation to see just what snippet parameters are available, and what placeholders are available. Leave the styling to the CSS.

                http://rtfm.modx.com/display/ADDON/Wayfinder

                This is also useful

                http://www.gregorysmart.com/downloads/The_almost_Complete_Guide_to_Constructing_Menus_in_MODx_Using_Wayfinder.pdf

                Lots of neat MODx stuff http://www.gregorysmart.com/

                  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