We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17412
    • 270 Posts
    It seems to me that Wayfinder doesn’t carry over the &showDescription parameter from DropMenu. I’ve added &showDescription=`1` and also &showDescription=`true` to the Wayfinder call though nada. Is that right?

      • 12295
      • 30 Posts
      Hi lokust,

      that’s exactly the same question I want to ask.
      I am used to build my sitemap with DropMenu and &showDescription is very nice.
      I was searching the docs to do the very same with wayfinder, but found nothing.

      Can someone confirm, that’s not possible to get the same result with Wayfinder as DropMenu with &showDescription?

      BTW,. the standard install of 0.95 has [[Wayfinder? &startId=`0` &showDescription=`1`]] called in 404 Error Page ;-)

      Thanks,
      Friedhelm
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        In your chunk template for the rows, just put [+wf.description+] where you want it to show.

        <li><a href="[+wf.link+]">[+wf.linktext+]</a> - [+wf.description+]</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
          • 12295
          • 30 Posts
          Thanks for the pointer and quick reply.
          I guess, one can find the placeholders for Wayfinder in wayfinder.inc.php:
              var $placeHolders = array('[+wf.wrapper+]','[+wf.classes+]','[+wf.classnames+]','[+wf.link+]','[+wf.title+]','[+wf.linktext+]','[+wf.id+]','[+wf.attributes+]','[+wf.docid+]','[+wf.introtext+]','[+wf.description+]','[+wf.subitemcount+]');


          I did a quick test on the 404 page:
          ][[Wayfinder? &startId=`0` &rowTpl=`wfRowTpl` &innerRowTpl=`wfInnerRowTpl `&debug=`1`]]

          where
          wfRowTpl:
          <li><a href="[+wf.link+]">[+wf.linktext+]</a> - [+wf.description+]</li>

          and
          wfInnerRowTpl:
          <li><a href="[+wf.link+]">[+wf.linktext+]</a> [+wf.wrapper+] - [+wf.description+]</li>


          Output doesn’t list the subitems, however debug shows me, my templates are used.
          I, as newbie, must miss something obvious ;-)
          Any further hint?
          Thanks
          Friedhelm

          p.s.: modx 0.95 standard install, wirh demo content
            • 15987
            • 786 Posts
            you need to add the placeholder [+wf.wrapper+] to the wfRowTpl chunk. This placeholder gets replaced with the submenus.
              • 12295
              • 30 Posts
              Thanks, that did the trick. I must read the docs for wayfinder once again and more carefully;-)
              However, used with &showDescription, wayfinder shows the same bug as DropMenu did

              <li><a href="/templates.html">Templates</a>
                <ul>
                    <li><a href="index.php?id=39&template=MODxHost">MODxHost</a> - MODxHost</li>
                     <li><a href="index.php?id=39&template=MODxCss">MODxCSS</a> - MODxCSS</li>
                     <li><a href="index.php?id=39&template=MODxCSS%20Wide">MODxCSSW</a> - MODxCSSW</li>
                </ul>
               - Templates</li>
              


              As you can see, description for Templates is written under the subitems. Looks a bit misplaced. Could that be fixed? Any pointer where to fix this?

              Thanks
              Friedhelm
                • 15987
                • 786 Posts
                In your template put the [+description+] placeholder before the [+wrapper+] placeholder.
                  • 12295
                  • 30 Posts
                  Short time after I wrote my message I did exactly this ;-)

                  wfRowTpl:
                  <li><a href="[+wf.link+]">[+wf.linktext+]</a> - [+wf.description+]  [+wf.wrapper+]</li>


                  Sorry for the noise and thanks!

                  Friedhelm

                  p.s.: maybe this should be included in the demo content for the next release?
                    • 12295
                    • 30 Posts
                    May I add &showDescription along with an example in the wiki?

                    Friedhelm
                      • 15987
                      • 786 Posts
                      you can add anything you want to the wiki, as long as it is accurate smiley