We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32380
    • 137 Posts
    When i use Wayfinder it applies the class="active" it the <li> tag, is there anyway i can change this to the <a> tag instead ?

    example

    Wayfinders way
    <li class="active"><a href="/modx/index.php?id=6" title="Swift Home Improvements Ltd" >Home</a></li>

    but i would like it this way if poss
    <li><a href="/modx/index.php?id=6" class="active" title="Swift Home Improvements Ltd" >Home</a></li>

    Hope someone can help smiley

      • 7231
      • 4,205 Posts
      No problem. Use the &rowTpl and set a custom template for the output:

      Create a chunk with this content and name it whatever you want (I will call it MyRowTpl):
      <li>
      <a [+wf.classes+] href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
      [+wf.wrapper+]
      </li>

      And in your Wayfinder call add &rowTpl=`MyRowTpl`:
      [!Wayfinder? startId=`xx` &rowTpl=`MyRowTpl`!]


      Find out more about the Wayfinder templates at:
      http://www.muddydogpaws.com/development/wayfinder/parameters.html
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don&#39;t know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 32380
        • 137 Posts
        Im a bit of a newbie to MODx but i created the chunk as stated (i copied n pasted) then i added the call to the template, where i wanted the links to show but it doesnt seem to be working, thanks for your quick reply
          • 32380
          • 137 Posts
          No worries i figured it out, thanks for pointing me in the right direction, i used the following alteration to your code

          [[Wayfinder? &startId=`0`&rowTpl=`MyRowTpl`]] and it worked, thanks again

          http://www.webmonsters.co.uk/modx/ (my demo site)