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

    Sorry if im missing something obvious but I know as standard the class="active" is on the "li" but is it possible for me to have it on the link A tag?

    eg. <li><a class="active" etc

    Cheers

    Brett
      • 25663 MODX Staff
      • 12,272 Posts
      Yes, just create a new template for the here row using the relevant parameter.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 22969
        • 158 Posts
        Thanks for replying but your need to be more specific, im still very new to modx, loving it though but still new and learning...

        Cheers
          • 25663 MODX Staff
          • 12,272 Posts
          There’s a ton of documentation on using Wayfinder in the eBook found at http://modxcms.com/learn/it.html
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 22969
            • 158 Posts
            Hi Ryan,

            thanks for replying but im struggling to find any reference to the "here row" that you mentioned, sorry if im being naive.

            Brett
              • 25663 MODX Staff
              • 12,272 Posts
              From /assets/snippets/wayfinder/wayfinder.documentation.html that installs with your MODx installation:
              &hereTpl	 the template chunk for the current document placeholders: same as rowTpl
              example: <li[+wf.classes+]><span>[+wf.linktext+]</span>[+wf.wrapper+]</li>


              Also listed in the list of parameters when viewing the snippet.

              For your purposes, you’d make a chunk: {{myCustomHereTpl}}

              <li><a class="active">[+wf.linktext+]</a></li>


              And add it with the &hereTpl parameter in your Wayfinder call:

              [[Wayfinder? &startID=`0` &hereTpl=`myCustomHereTpl` ... ]]
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 22969
                • 158 Posts
                Hi Ryan,

                Thank you thats perfect, just one hiccup, the class "last" isnt getting applied now to the last li element?

                When I tried adding class="[+wf.classnames+]" its adding both last & active to the il?

                So I have this - <li class="[+wf.classnames+]"><a class="active">[+wf.linktext+]</a></li>

                Can anyone help me at all? At a loose end :-(

                Cheers

                Brett
                  • 22969
                  • 158 Posts
                  Can anyone help with this?

                  Sorry to pester but im at a standstill at the moment, any advice would be greatly received smiley

                  Brett
                    • 16183
                    • 1,390 Posts
                    Brett,

                    Maybe it would be better if you posted here all the WF template chunks you are using (including type, i.e. rowTpl, etc) plus your WF call for closer inspection. It might be a case whereby there’s 2 or more WF templates applicable to a certain menu items and both will not be applied...WF has a specific template processing order. In addition, mention the version of WF you are using and if any of your menu items are weblinks.

                    cheers/k
                      • 22969
                      • 158 Posts
                      Hi Kongondo,

                      Im just using the one bit of code for my naivgation:

                      [!Wayfinder?&startId=`0`&level=1&titleOfLinks=`longtitle` &hereTpl=`menuActive`!]

                      menuActive chunk:

                      <li class="[+wf.classnames+]"><a class="[+wf.classnames+]">[+wf.linktext+]</a></li>

                      This is what my problem outputted html is:

                      <ul>
                      <li><a href="/index.php" title="" >Home</a></li>
                      <li><a href="/index.php?id=2" title="" >About Us</a></li>
                      <li><a href="/index.php?id=3" title="" >Our Work</a></li>
                      <li class="last active"><a class="last active">Contact Us</a></li>
                      </ul>

                      Just to add to my problem, the active class isnt being applied to the "a" tag on a parent that has a childredirect snippet being applied to?

                      Thanks Kongondo for any help you can give me?

                      Brett