We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 52662
    • 4 Posts
    Good day all!
    I'm beginner in MODX Revo.

    I have a (maybe simple) question. I have menu with 2 levels. How to remove link from parent level if there is submenu?

    MODX Revolution version: 2.5.1

    menu:
    [[Wayfinder? 
    	&startId=`0`
    	&level=`2`
    	&outerTpl=`outerTpl`
    	&innerTpl=`innerTpl`
    	&rowTpl=`rowTpl`
    	&parentRowTpl=`parentRowTpl`
    	]]
    


    outerTpl:
    <ul class="nav clear">
      [[+wf.wrapper]] 
    </ul>
    


    innerTpl:
    <ul class="sec_nac">
      [[+wf.wrapper]]
    </ul>
    


    rowTpl:
    <li [[+wf.classes]]>
      <a href="[[+wf.link]]">[[+wf.linktext]]</a>
    </li>
    


    parentRowTpl:
    <li class="active open_sec_nav [[+wf.classnames]]"><a href="[[+wf.link]]">[[+wf.linktext]]</a>
      [[+wf.wrapper]]
    </li>
    


    There is no content to put in parent page, so I need to disable link.

    I read this post: https://forums.modx.com/thread/40823/how-to-disable-clickable-in-one-link-wayfinder

    tried to do same, but nothing changed. Cache cleared.
      • 4172
      • 5,888 Posts
      just removing the link from parentRowTpl should do it.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 52662
        • 4 Posts
        Quote from: Bruno17 at Aug 19, 2016, 09:42 AM
        just removing the link from parentRowTpl should do it.

        Thank you Bruno for quick reply!, did it, now all parents with submenus removed, there is only links with 1st level where no submenus. [ed. note: a.mustafin last edited this post 8 years, 2 months ago.]
          • 4172
          • 5,888 Posts
          <li class="active open_sec_nav [[+wf.classnames]]">[[+wf.linktext]]
            [[+wf.wrapper]]
          </li>
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 52662
            • 4 Posts
            Yes sure, I did same, and parents with submenus removed.

            If I put this:
            <li class="active open_sec_nav [[+wf.classnames]]"><a href="#">[[+wf.linktext]]</a>
              [[+wf.wrapper]]
            </li>
            

            parent link is with # link and submenus are ok.

            Is there any other way to solve this?
              • 52662
              • 4 Posts
              Sorry, problem was in css. It works, thank you.