@@ -34,7 +34,7 @@ In the template:
34
34
<nav>
35
35
<ul>
36
36
<?php foreach ($menu as $menuItem) : ?>
37
- <li><a href="<?= $menuItem->url() ?>"><?= $menuItem->title() ?></a></li>
37
+ <li><a <?php e($menuItem->isOpen(), 'aria-current="page"') ?> href="<?= $menuItem->url() ?>"><?= $menuItem->title() ?></a></li>
38
38
<?php endforeach ?>
39
39
</ul>
40
40
</nav>
@@ -72,7 +72,7 @@ In the template, we can use it like this to render each menu with its headline:
72
72
<h4><?= $menu->menuHeadline()->html() ?></h4>
73
73
<ul>
74
74
<?php foreach ($menuItems as $menuItem) : ?>
75
- <li><a href="<?= $menuItem->url() ?>"><?= $menuItem->title() ?></a></li>
75
+ <li><a <?php e($menuItem->isOpen(), 'aria-current="page"') ?> href="<?= $menuItem->url() ?>"><?= $menuItem->title() ?></a></li>
76
76
<?php endforeach ?>
77
77
</ul>
78
78
</nav>
@@ -112,7 +112,7 @@ In the template:
112
112
<nav>
113
113
<ul>
114
114
<?php foreach ($menuItems as $menuItem) : ?>
115
- <li><a href="<?= $menuItem->link()->toUrl() ?>"><?= $menuItem->linkTitle()->or($menuItem->link()->html()) ?></a></li>
115
+ <li><a <?= ($p = $menuItem->link()->toPage()) && $p->isOpen() ? 'aria-current="page"' : '' ?> href="<?= $menuItem->link()->toUrl() ?>"><?= $menuItem->linkTitle()->or($menuItem->link()->html()) ?></a></li>
116
116
<?php endforeach ?>
117
117
</ul>
118
118
</nav>
@@ -157,7 +157,7 @@ if ($menu->isNotEmpty()) : ?>
157
157
<ul>
158
158
<?php foreach ($menu as $item): ?>
159
159
<?php if ($mainMenuItem = $item->mainMenu()->toPage()) : ?>
160
- <li><a href="<?= $mainMenuItem->url() ?>"><?= $mainMenuItem->title() ?></a>
160
+ <li><a <?php e($mainMenuItem->isOpen(), 'aria-current="page"') ?> href="<?= $mainMenuItem->url() ?>"><?= $mainMenuItem->title() ?></a>
161
161
<?php endif ?>
162
162
<?php $subMenu = $item->subMenu()->toPages(); ?>
163
163
<?php if ($item->hasSubmenu()->isTrue() && $subMenu->isNotEmpty()) : ?>
0 commit comments