We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19872
    • 1,078 Posts
    Working with wayfinder, and I have one top level nav item that will have 2 or 3 items in a drop menu. I really don't have any content for use as a landing page. Is there a way to set this one nav item to do nothing but serve as a trigger for the drop menu?

    Is this something I set on the parent folder resource settings?
      • 22427
      • 793 Posts
      You could use FirstChildRedirect
      • If you put rel="category" in the Attributes field of the resource, then use the &categoryFoldersTpl property in the Wayfinder snippet, you can use a chunk tpl that doesn't have the <a> tags. I usually use <span> tags instead, then in my CSS I can style the span to match the links in the rest of the menu items.
          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
          • 36996
          • 211 Posts
          You can also add a class or id to that parent and then preventDefualt onclick with javascrtipt.

          Using jQuery you can have something like this:

          (function($){
              $('.category').on('click', function(e){
                  e.preventDefault();
                  $(this).find('ul').show();
              });
          })(jQuery);
          


            • 19872
            • 1,078 Posts
            Thanks for all of the great suggestions. I'll try them out.
              • 23018
              • 353 Posts
              This is basically the same as firstchildredirect,

              but It might be helpful to create those first level items as weblinks aimed at the first item in your list. You can optionally hide these items from your navigation if you don't want to have two links aiming at the same content.

              Cheers,

              pepebe
                Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
                • 19872
                • 1,078 Posts
                Quote from: pepebe at Oct 13, 2014, 12:28 PM
                This is basically the same as firstchildredirect,

                but It might be helpful to create those first level items as weblinks aimed at the first item in your list. You can optionally hide these items from your navigation if you don't want to have two links aiming at the same content.

                Cheers,

                pepebe

                This sounds like the quickest and easiest method to implement. Thanks for the tip. And, coincidentally, the first child is the most important page I want users to get to.
                  • 10076
                  • 1,024 Posts
                  Or, make that document type a weblink and as url link to the firts item in your dropdown?
                    • 19872
                    • 1,078 Posts
                    Yes. I think the weblink might be the way to go. Have to implement and make sure it doesn't impeded my current functionality for the mobile version of the menu. Thanks for the tip.