[Wayfinder] Is there a way to detect a child page or not


I am using with 1 to 3 level with wayfinder.

[[!Wayfinder? &startId=[[UltimateParent?id=[[*id]] &topLevel=1]] &level=2 &rowTpl=rowTpl &outerClass=navbar-nav &innerClass=innerUl &levelClass=level &hideSubMenus=0 &hereClass]]

As you can see, I am using


That will add a class for each li and add the level number


That nice but if my level has only one level, it will print this

<li class="level1 active"></li>

As there is no sublevel, it will be helfull if the class .level1 is not add the the li.

Is there a way to say to wayfinder (or another way) to add the class .levelX only if there is sub pages?


Maybe you can just add the &parentClass=`parent` property and then make the distinction in CSS whether only the class level1 is present or also the class parent.

Another way is to delete the property &levelClass=`level` and instead add a special template just for parent pages:


In the chunk parentRowTpl you can then output the classes for the levels with the placeholder [[+wf.level]].

class="[[+wf.classnames:notempty=`[[+wf.classnames]] `]]level[[+wf.level]]"

Thanks a lot, I am going to try later in the day. I let you know.