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

    I’ve read through many forum posts as I’m becoming acquainted with modx and have found them quite useful. I couldn’t figure this one out though...

    I have a wayfinder call to display a sub menu: [[!Wayfinder? &startId=`[[UltimateParent]]` &displayStart=`1` &level=`0` ]] which works perfectly, except I want the top level item to also be a link (it’s currently just a h2).

    Current output code is:
    <div id="subMenuDiv">
                <ul>
                  <h2 class="first active">Members</h2><ul><li class="first"><a title="Membership Benefits" href="index.php?id=7">Membership Benefits</a></li><li><a title="Membership Costs" href="index.php?id=8">Membership Costs</a></li><li class="last active"><a title="Other Membership Information" href="index.php?id=9">Other Membership Information</a></li></ul> 
                </ul>
              </div>


    But I’d like it to be:
    <div id="subMenuDiv">
                <ul>
                  <a href="index.php?id=3"><h2 class="first active">Members</h2></a><ul><li class="first"><a title="Membership Benefits" href="index.php?id=7">Membership Benefits</a></li><li><a title="Membership Costs" href="index.php?id=8">Membership Costs</a></li><li class="last active"><a title="Other Membership Information" href="index.php?id=9">Other Membership Information</a></li></ul> 
                </ul>
              </div>


    I’m sure it’s easy, I just can’t figure it out.

    Cheers,

    Angus
      • 11525
      • 5 Posts
      Hi All,

      I’m still waiting for a reply, is this possible?
        • 560
        • 0 Posts
        I’d like to know as well.
          • 11525
          • 5 Posts
          You need to edit the templates for Wayfinder. Check out the Wayfinder documentation and look at inner_tpl and outer_tpl and edit the one you need to edit. It will involve creating a new chunk, copying the standard version of the template from the documentation then making the change you need.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Use the startItemTpl to have the opening <ul> tag and put the start item in <li>...</li> tags to match the rowTpl. Don’t close the ul, and don’t forget to put the [+wf.wrapper+]. The outerTpl will only contain the </ul> tags to close the list.

            http://sottwell.com/startitem.html
              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