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

    I'm trying to adapt a menu to MODX via Wayfinder;

    This is how my menu should look like :

    <ul class="sf-menu" id="nav">
              <li class="current"><a href="index.html">Accueil</a></li>
    			<li><a href="informations.html">Informations</a></li>
              <li><a href="agenda.html">Agenda</a></li>
              <li><a href="#">Photos</a>
                <ul>
                  <li><a href="#">2012</a></li>
                  <li><a href="#">2011</a>
                    <ul>
                      <li><a href="#">Journée sportive</a></li>
                      <li><a href="#">Voyage des rhéto</a></li>
                      <li><a href="#">2 heures pour la vie</a></li>
                    </ul>
                  </li>
                  <li><a href="#">2010</a></li>
                  <li><a href="#">2009</a></li>
                  <li><a href="#">2008</a></li>
                </ul>
              </li>
              <li><a href="#">Site pédagogique</a></li>
              <li><a href="#">Contact</a></li>
            </ul>
    


    But i have a problem with the id="nav" part.

    i used this code
    [[Wayfinder? &startId=`0`&level=`0`&outerClass=`sf-menu`]]
    


    But it's not complete to show the id="nav" part

    Can someone help me to fix this ?

    Thanks !

    Sub [ed. note: subran last edited this post 11 years, 5 months ago.]
      • 22840
      • 1,572 Posts
      You will need to use a outertpl so something like:
      [[Wayfinder? &startId=`0`&level=`0` &outerTpl=`nav`]]

      Then create a chunk called nav and add the below to it
      <ul class="sf-menu" id="nav">[[+wf.wrapper]]</ul>


      http://rtfm.modx.com/display/ADDON/Wayfinder
        • 36098
        • 46 Posts
        It works like a charm !

        Thanks a lot !
        • It also uses a "current" classname, while Wayfinder by default uses "active". So you'll either need to edit the CSS or give Wayfinder a property to change the classname for the active item.
            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