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

Hello,

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

levelClass=`level

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

li.level1
li.level2
li-level3

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

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

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?

Thanks

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:

&parentRowTpl=`parentRowTpl`

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]]"

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