I’m creating a simple menu that opens when you hover it and shows the children of the page.
I’m looking for a solution to excludes the current active page from this list. Looking at the cheatsheet the “$pages->not()” and “$pages->findOpen()” seems to be the thing to do but not sure… Is this the best approach?
here is a example of the code:
<?php foreach(page('index')->children()->not('findOpen()') as $child): ?> <li><a href="<?php echo $child->url(); ?>"><?php echo $child->title(); ?></a></li> <?php endforeach ?>