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


    My client just asked me to "remove" links from some items in a main menu...and heh, well I just don’t find any parameter to exclude some PARENT document WHILE letting its child documents still being listed into the menu as usual links huh..
    Right ?

    any clue?

    Thank you ?
      Schtroumpf Grognon - Grouchy Smurf
      ---------------------------------
      Faites pas attention.. - Don't pay attention
      http://www.dzi-neo.net
      • 26016
      • 561 Posts
      Hi Grouchy (good name!),
      Somebody had a post about that last week - the solution involved writing some really clever conditional code in a Wayfinder template, so if you search a bit more maybe you’ll find it. I didn’t find it immediately. That solution was for Revo, btw. But you could probably also do that for Evo with PHx maybe.

      I’m lazier than that, and I usually just do it with CSS, z-index settings, and a Wayfinder parm or two. The link is there, but it’s unclickable. The only problem with my approach is that if the reason for disabling the link is for SEO, then my way is not the best. So if someone’s super-fastidious about SEO, the other way is probably better.

      Using FirstChildRedirect is a common way around that, so you default to a particular menu item under it, but a hardcore SEO guy I worked with before didn’t like that.

      Cheers, Dave
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        If you use an external config file for Wayfinder instead of a parameter list in the snippet call, since that external config file is a standard .php file you can have the tpl code directly in the config file, and code all kinds of conditionals into them.
          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
          • 8790
          • 526 Posts
          thank you for those ideas.

          Going into a hard coding is probably not my way, but I’ll think about it.

          For the moment adding a
          onClick="return false;"

          into the link attributes will do the job

          or the Firstchildredirect.
            Schtroumpf Grognon - Grouchy Smurf
            ---------------------------------
            Faites pas attention.. - Don't pay attention
            http://www.dzi-neo.net
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Here you go...
            &categoryFoldersTpl
            default: NULL
            values: name of template chunk
            description: The categoryFoldersTpl is used when the item is a folder, and either has the template set to
            blank or has rel="category" in the link attributes field. The children of the item must be displayed for this
            template to be used as well.
            available placeholders: Same as RowTpl.
            example:
            <li[+wf.classes+]>
            <a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
            [+wf.wrapper+]
            </li>
              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
              • 8790
              • 526 Posts
              nice shot. Thank you

              Redactor is supposed to know how to deal with this, but it’s probably the best solution
                Schtroumpf Grognon - Grouchy Smurf
                ---------------------------------
                Faites pas attention.. - Don&#39;t pay attention
                http://www.dzi-neo.net
                • 33968
                • 863 Posts
                Not sure if I followed correctly here, but couldn’t you just specify a parentRowTpl chunk with no link in it?

                Something like:

                [[!Wayfinder? &parentRowTpl=`chunk`]]

                Where ’chunk’ contains
                <li[[+wf.classes]]>[[+wf.linktext]][[+wf.wrapper]]</li>


                That would mean that any menu container item would have no link, but should preserve any links in the children.

                  • 8790
                  • 526 Posts
                  Hi

                  Previous solution was the right stuff.

                  I needed SOME parents not to be link, not ALL of them.
                    Schtroumpf Grognon - Grouchy Smurf
                    ---------------------------------
                    Faites pas attention.. - Don&#39;t pay attention
                    http://www.dzi-neo.net