dklemmt / contao_dk_mmenu

Implementation of mmenu as extension for Contao Open Source CMS
15 stars 16 forks source link

Suchfeld funktioniert nicht #61

Closed contaoacademy closed 3 years ago

contaoacademy commented 3 years ago

Problem: Wird das Suchfeld aktiviert, erscheint dieses, es werden allerdings keine Menü-Einträge gefunden.

Ursache Das Problem liegt wohl am Aufbau des Menü-Templates. Sobald im nav_mmenu.html5 alle Span-Tags entfernt werden, dann funktioniert die Suche nach den einzelnen Menüelementen.

Funktioniert nicht

<li class="mm-listitem mm-hidden" aria-hidden="true">
<a href="erweiterungen.html" title="Erweiterungen" itemprop="url" class="mm-listitem__text">
<span itemprop="name">Erweiterungen</span>
</a>
</li>

Funktioniert

<li class="mm-listitem mm-hidden" aria-hidden="true">
<a href="erweiterungen.html" title="Erweiterungen" itemprop="url" class="mm-listitem__text">
Erweiterungen
</a>
</li>
contaoacademy commented 3 years ago

@fritzmg Hast du eine Idee, ob sich das einfach lösen lässt? Wie hoch schätzt du den Aufwand?

fritzmg commented 3 years ago

Versuche es mal mit folgendem nav_mmenu.html5 Template:


<ul class="<?= $this->level ?>">
  <?php foreach ($this->items as $item): ?>
    <?php if ($item['isActive']): ?>
      <li class="<?= $item['class'] ?>"><span class="<?= $item['class'] ?>"<?php if (!empty($item['subitems'])) echo ' aria-haspopup="true"'; ?> itemprop="name"><?= $item['link'] ?></span><?= $item['subitems'] ?></li>
    <?php else: ?>
      <li<?php if ($item['class']) echo ' class="' . $item['class'] . '"'; ?>><a href="<?= $item['href'] ?: './' ?>" title="<?= $item['pageTitle'] ?: $item['title'] ?>"<?php if ($item['class']) echo ' class="' . $item['class'] . '"'; ?><?php if ($item['accesskey'] !== '') echo ' accesskey="' . $item['accesskey'] . '"'; ?><?php if ($item['tabindex']) echo ' tabindex="' . $item['tabindex'] . '"'; ?><?php if ($item['nofollow']) echo ' rel="nofollow"'; ?><?= $item['target'] ?><?php if (!empty($item['subitems'])) echo ' aria-haspopup="true"'; ?> itemprop="url"><?= $item['link'] ?></a><?= $item['subitems'] ?></li>
    <?php endif; ?>
  <?php endforeach; ?>
</ul>
contaoacademy commented 3 years ago

Vielen Dank, das funktioniert.

fritzmg commented 3 years ago

Fixed in 3.2.4.