1
votes

Ref: Wayfinder on Modx Revo

I've been searching extensively and couldn't find the answer.

I find a very tricky situation trying to output an extra attribute with the list item that wraps the current menu (the menu link on of the page you're currently in). For example: Instead of just this line..

<li class="current"><a href="#">This is the menu</a></li>

I want..

<li class="current" value="1"><a href="#">This is the menu</a></li>

see value="1"

I tried creating a chunk in relation with the &hereTpl parameter but apparently this parameter is no longer valid in Wayfinder Revo (or is it?).

I think another possible route is if there's a way for a conditional inside the &rowTpl to render the needed attribute only for the current menu but again another brick wall.

I also tried the [[+wf.attributes]] (on the list item tag in the template chunk and put the needed attribute in the Link attributes of all the the resources/documents assuming it's going to render only when the resource/document is "current" but then the attribute is just outputted to all the menu items.

Could you share a thought? thanks so much for any help.

1
Looking at the code and documentation, hereTpl is indeed still validPhil
Hi thanks. I did use &hereTpl=myTpl but seems like it's not parsing. I'll re-check. Thx for the feedback I really appreciate.rix
I can't figure a way to put the back tick sign.. but you know what I mean.. thx @Philrix
I should've included the call to wayfinder I am using.. [[Wayfinder? &startId=10 &level=1 &hereTpl=navHere &levelClass=level &outerTpl=navOuter &firstClass=first &lastClass=last &sortBy=menuindex &sortOrder=ASC &titleOfLinks=longtitle]]rix

1 Answers

0
votes

do the following:

[[Wayfinder? &hereTpl=`navHere` (INCLUDE OTHER PARAMETERS THAT YOU LIKE)]]

In the navHere tpl write the following piece of code:

<li class="current" value="1"><a href="[[+wf.link]]">[[+wf.linktext]]</a></li>[[+wf.wrapper]]

I understand this would work out. Hope to get a response from you.