diff options
| author | Moritz Strohm <strohm@data-quest.de> | 2024-05-28 14:31:53 +0000 |
|---|---|---|
| committer | Moritz Strohm <strohm@data-quest.de> | 2024-05-28 14:31:53 +0000 |
| commit | cc617253eb92d8e57d82dcc269a2f535681931a4 (patch) | |
| tree | 1b5bb8ad15ac02bf3902eae9aa53923d273a17d5 /templates/header.php | |
| parent | e9806e73f7d91f0810a298bc6c9139e6da138575 (diff) | |
display skip links for first and second navigagion layer only when there are elements, fixes #4049
Closes #4049
Merge request studip/studip!2949
Diffstat (limited to 'templates/header.php')
| -rw-r--r-- | templates/header.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/templates/header.php b/templates/header.php index b875038..711d517 100644 --- a/templates/header.php +++ b/templates/header.php @@ -216,7 +216,9 @@ if ($navigation) { <!-- Main navigation and right-hand logo --> <nav id="navigation-level-1" aria-label="<?= _('Hauptnavigation') ?>"> - <? SkipLinks::addIndex(_('Hauptnavigation'), 'navigation-level-1', 2, false); ?> + <? if (!empty($header_nav['visible'])) : ?> + <? SkipLinks::addIndex(_('Hauptnavigation'), 'navigation-level-1', 2, false) ?> + <? endif ?> <ul id="navigation-level-1-items" <? if (count($header_nav['hidden']) > 0) echo 'class="overflown"'; ?>> <? foreach ($header_nav['visible'] as $path => $nav): ?> <?= $this->render_partial( @@ -297,10 +299,12 @@ if ($navigation) { </div> <? endif ?> - <? SkipLinks::addIndex(_('Zweite Navigationsebene'), 'navigation-level-2', 910) ?> <nav id="navigation-level-2" aria-label="<?= _('Zweite Navigationsebene') ?>"> <? if (PageLayout::isHeaderEnabled() /*&& isset($navigation)*/) : ?> + <? if (!empty($navigation)) : ?> + <? SkipLinks::addIndex(_('Zweite Navigationsebene'), 'navigation-level-2', 910) ?> + <? endif ?> <?= $this->render_partial('tabs', compact('navigation')) ?> <? endif; ?> </nav> |
