kirby-navigation
kirby-navigation copied to clipboard
Highlight active menu item
Hey,
thanks for the awesome plugin. Is it possible to highlight the active menu item?
I use:
<?php foreach($site->navigation()->toStructure() as $navigation): ?>
<li>
<a <?php e($navigation->isOpen(), 'aria-current') ?> id="<?php echo $navigation->id() ?>" href="<?php echo $navigation->url(); ?>" <?php echo $navigation->popup()->toBool() ? 'rel="noopener noreferrer" target="_blank"' : '' ?>>
<?php echo $navigation->text() ?>
</a>
</li>
<?php endforeach ?>
and insert in the a-Tag this
<?php e($navigation->isOpen(), 'aria-current') ?>
Than all items are highlighted. What am I doing wrong?
Thanks for your help!
@LordCanis felt on the same issue, a workaround was given in this issue #18 in the last comment, it worked for me with kirby 3.7.3 with the navigation plugin version 3.0.0