We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12410
    • 353 Posts
    Hi Guys,
    If I have the following navigation/resources and using a multilevel dropdown menu like Superfish:

    News ...not to go to url
    >item 1 ...go to url
    >item 2 ...go to url
    >item 3 ...go to url

    I want the user to click on "News" for the purposes of revealing the child links item 1 - 3 on my nav menu only. If user click on "News" i dont want them going to a url. If they click on item 1-3 I want them brought to the corresponding page.

    I am using Wayfinder to populated the menu items.

    How do I achieve this?
    Thanks

    Modx Revo 2.0.8

      • 7914
      • 137 Posts
      well, a quick option using jquery is that you could listen for the "news" click then use the "preventDefualt" on that link to prevent the browser from going to the next page. (Similar to return FALSE)

      check out the docs for a better overview on "preventDefault".

      That’s where I would start...
        • 12410
        • 353 Posts
        Thanks very much dowhatnow for the reply i will look into that as it seems to be very useful. I was hoping wayfinder had a way of doing it via parameters. I kninda want Superfih to work like an Accordion menu where the parent link only serves to reveal the child links.
          • 12410
          • 353 Posts
          This kinda works:

          <li [[+wf.classes]]><a href="[[*id]]" title="[[+wf.title]]" [[+wf.attributes]]><span>[[+wf.linktext]]</span></a>[[+wf.wrapper]]</li> 


          If user clicks on parent link it just refreshes/calls the current page. Child links work as normal