Wenn man eine Seite im Menü stehen haben, aber nicht verlinken möchte, kann man dies mit Hilfe der terminal42/folderpage Extension und nachfolgender Änderung des nav_default Templates tun:
Vor das öffnende <a> Tag im Template:
PHP-Code:
<?php if ($item['type'] != 'folder'): ?>
Nach dem schließenden </a> Tag:
PHP-Code:
<?php endif; ?>
Zusätzlich muss unter diesem gesamten Block folgende Abfrage eingebaut werden:
PHP-Code:
<?php if ($item['type'] === 'folder'): ?><span class="<?php if ($item['class']): ?><?= $item['class'] ?><?php endif; ?>" <?php if (!empty($item['subitems'])): ?> aria-haspopup="true"<?php endif; ?> itemprop="url"><span itemprop="name"><?= $item['link'] ?></span></span><?php endif; ?>
Im Ergebnis sieht das dann ungefähr so aus:
PHP-Code:
<ul class="<?= $this->level ?>">
<?php foreach ($this->items as $item): ?>
<?php if ($item['isActive']): ?>
<li class="<?= $item['class'] ?>"><strong class="<?= $item['class'] ?>"<?php if (!empty($item['subitems'])): ?> aria-haspopup="true"<?php endif; ?> itemprop="name"><?= $item['link'] ?><?= $strBadge ?></strong><?= $item['subitems'] ?></li>
<?php else: ?>
<li<?php if ($item['class']): ?> class="<?= $item['class'] ?>"<?php endif; ?>><?php if ($item['type'] != 'folder'): ?><a href="<?= $item['href'] ?: './' ?>" title="<?= $item['pageTitle'] ?: $item['title'] ?>" class="<?php if ($item['class']): ?><?= $item['class'] ?><?php endif; ?>"<?php if ('' !== $item['accesskey']): ?> accesskey="<?= $item['accesskey'] ?>"<?php endif; ?><?php if ($item['tabindex']): ?> tabindex="<?= $item['tabindex'] ?>"<?php endif; ?><?= $item['target'] ?><?= $item['rel'] ?><?php if (!empty($item['subitems'])): ?> aria-haspopup="true"<?php endif; ?> itemprop="url"><span itemprop="name"><?= $item['link'] ?></span></a><?php endif; ?>
<?php if ($item['type'] === 'folder'): ?><span class="<?php if ($item['class']): ?><?= $item['class'] ?><?php endif; ?>" <?php if (!empty($item['subitems'])): ?> aria-haspopup="true"<?php endif; ?> itemprop="url"><span itemprop="name"><?= $item['link'] ?></span></span><?php endif; ?><?= $item['subitems'] ?></li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
Es wird dann jede Seite zu einem <span>, die vom Typ "Ordner" ist.
Lesezeichen