Active Page ...if has visible children

Hey Guys,

I would like to know if there is a possibility to give a list a special css class when the currently active page has visible children…or when the currently active page is a children.

I tried stuff like “isActive()->hasVisibleChildren()” but this comes up with errors… I am fairly new to Kirby - so I hope you can help me.

Regards
Sebastian

Try an and combination, since both isActive() and hasVisibleChildren() return a boolean value and for that can’t be combined in the way you tried, i.e.

if ($page->isActive() && $page->hasVisibleChildren()) {  echo "class='someclass'" }

good point, thanks a lot! :wink: