We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6174
    • 0 Posts
    Hi everyone,

    I have a link on menu that contains dropdown menu and I want this link can not be clicked (cause it has nothing except dropdown menu).
    So could anybody tell me how to do that in wayfinder or js if it possible?

    Thanks for all supports,
      • 20413
      • 2,877 Posts
      One way of doing it is using the PHx plugin (or output filters in revo)
      so if you have tpl like this
      <li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>
      


      Then with PHx you would do
      <li[+wf.classes+]>[+phx:if=`[+wf.docid+]`:ne=`5`:then=`<a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
      `:else=`[+wf.linktext+]`+]
      [+wf.wrapper+]</li>
      

      That is saying if item is NOT resource ID 5 show link else just text.
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 24665
        • 14 Posts
        I have the same issue (using 2.1.3 and wayfinder). Is there a more "native" way of achieving this without PHx? smiley
          • 33968
          • 863 Posts
          You could specify a custom chunk for &parentRowTpl, removing the link tag.

          This would apply to any menu item containing a sub-menu.

          Create a new chunk parentRowTpl
          <li[+wf.classes+]>[+wf.linktext+][+wf.wrapper+]</li>  (evo)
          <li[[+wf.classes]]>[[+wf.linktext]][[+wf.wrapper]]</li>  (revo)
          

          Then your snippet call:
          [!Wayfinder? &startId=`0` &parentRowTpl=`parentRowTpl`!]  (evo)
          [[!Wayfinder? &startId=`0` &parentRowTpl=`parentRowTpl`]]  (revo)
          [ed. note: okyanet last edited this post 12 years, 7 months ago.]
            • 24665
            • 14 Posts
            Works great, thanks! smiley
              • 8822
              • 203 Posts
              Hi Folks, i know that this is an old post...........i have used the example suggested above to make parent menu items not clickable - this does however pose a problem in touch devices such as ipads/iphones - if the parent menu item is not clickable then it won't display the sub menu items - is there another way to achieve the desired result?
              • Should be able to use some javascript to do that; for example
                $('.my-link').bind('click',false);
                  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