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

    I want to release a template for modx but am having a wee issue with wayfinder. As such I have my template ready and almost ported to modx but I am having an issue with wayfinder. There will be 2 seperate navigation areas in the template e.g. top and bottom which are styles differently.

    As such I want the top code displayed as


    <div class="span-18 last">
    <p><ul id="nav">
    <li><a href="#" title="#">A</a></li>
    <li><a href="#" title="#">B</a></li>
    <li><a href="#" title="#">C</a></li>
    <li><a href="#" title="#">D</a></li>
    <li><a href="#" title="#">E</a></li>
    </ul></p>
    </div>

    Am I correct in thinking that I must create a &outerTpl such as


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

    Also does wayfinder generate class="selected"?

    Now for the second munu bar I want it to appear as


    <div class="span-11 last" id="footermenu"><p><a href="#" title="#">A</a> | <a href="#" title="#">B</a> | <a href="#" title="#">C</a> | <a href="#" title="#">D</a> | <a href="#" title="#">E</a></p></div>

    but am stumped on how to achieve this?

    Any help much appreciated
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The trick to using Wayfinder is to make up your menu manually the way you want it. Then step back and take a long look at exactly what you are doing. The outer structure elements will go in an outerTpl. Each menu item will go in a rowTpl. You can specify a classname for "active", which means the active page and all of its parents get the classname, and a "self" which means only the active page gets the classname. By default, Wayfinder sets the class="active" and class="last" attributes in the appropriate li elements. Custom tpls need to use [+wf.classes+] where these and any other custom attributes are wanted.

      Other custom tpls and attributes will vary according to your needs.

      Here’s my favorite cheat-sheet; I never leave home without it wink
        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
        • 51267
        • 25 Posts
        Is there any cheatsheet which show what the expected outcome should be and then shows how to achieve it using parameters, I cant seem to be able to get my head around it >:(
          • 28042 ☆ A M B ☆
          • 24,524 Posts
            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
            • 51267
            • 25 Posts
            Hmmm, if wayfinder uses unordered lists does that mean I should be using something else for the bottom navigation?
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Wayfinder can generate whatever you want. Unordered lists are the most common structure for menus, so that’s the default.

              The documentation I linked to explains Wayfinder’s mini-template system.
                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