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

    How do i get a menu like this:
    <ul>
    <li><a href="$page['url']" alt="$page['short_desc']">$page['linktekst']</a></li>
    </ul>
    

    I did read some tutorials , but unfortunately i don’t manage to get it like this.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      [[Wayfinder? &startId=`xx`]]

      where the xx is the document ID of the container/parent document where you want the menu to start from (0 if you want it to be from the top).

      There is a good document for Wayfinder in its wiki page.
        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
        • 2684
        • 5 Posts
        I already tried that , but how do i customize it?

        I want to give the <ul> tag a class and the <li> items no classname.

          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Take a look at the document you can download from the wiki page I linked to. It has all the parameters and settings you can use with Wayfinder. It also explains how to make your own custom output templates for it.
            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
            • 2684
            • 5 Posts
            Sorry, missed the document.
              • 2684
              • 5 Posts
              I red the document.

              Currently i’m getting this output:

              <ul><li class="active"><a href="http://www.adomain.com/testsite/cms2/" title="- Home" >Base Install</a></li>
              </ul>

              what i want is this:
              <ul id="menu"><li class="active"><a href="http://www.adomain.com/testsite/cms2/" title="- Home" >Base Install</a></li>
              </ul>

              Using &parentClass=`menu` does not give a classname to the unordered list.

              I can’t find a way to remove the "active" class also.

              I hope someone will be able to help me.
                • 4749
                • 623 Posts
                You’ve got to create your own template for example:

                <ul [+wf.id+]>
                [+wf.wrapper+]
                </ul>

                once you add that parameter then you can add your id="menu".


                  The MODx has you...
                  Utah Web Design
                  • 2684
                  • 5 Posts
                  So i first need to create a chunk with the menu layout and call that chunk in my template?
                    • 4749
                    • 623 Posts
                    If I understand correctly, the easiest way to do this is to add the &outerTpl parameter and specify your template. Create the following chunk:

                    <ul id="menu">
                    [+wf.wrapper+]
                    </ul>

                    Name the chunk "Outer," then call it in your wayfinder call:

                    [!Wayfinder? &startId=`10` &outerTpl=`Outer`!]
                      The MODx has you...
                      Utah Web Design