I’m trying to create a different way to add pages (and other URLS) to a menu with a structure field but I’m struggling with adding an active class to the list element with the current page url using the Kirby Link Field plugin (@hdodov). Is this possible?
I’ve tried the following but this gives every li a class of active.
It seems like one can get the Page from that by calling a $link->page() function (which might return null if the page doesn’t exist or the link isn’t a page), so I guess a way to get to isActive could be:
If the menu item is a page it should become active when you visit it.
If the item is a different url or a file it opens in a new tab (so no need for becoming active).