Browse Source

Frontend single language menu fix 2

master
Egorka 6 years ago
parent
commit
923455cffb
  1. 13
      core/widgets/menu/views/menu.php

13
core/widgets/menu/views/menu.php

@ -16,15 +16,22 @@
<?php foreach ($menu->items as $item): ?> <?php foreach ($menu->items as $item): ?>
<li class="<?= $item->isActive() ? 'active' : '' ?> nav-item<?= $item->hasChildren() ? ' dropdown' : '' ?>"> <li class="<?= $item->isActive() ? 'active' : '' ?> nav-item<?= $item->hasChildren() ? ' dropdown' : '' ?>">
<?php if ($item->hasChildren() && $item->parent_id == 0): ?> <?php if ($item->hasChildren() && $item->parent_id == 0): ?>
<a <?= $item->target ? 'target="'.$item->target.'"' : '' ?> href="<?= $item->getUrl() ?>" class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><?= $item->name ?></a> <a <?= $item->target ? 'target="' . $item->target . '"' : '' ?> href="<?= $item->getUrl() ?>"
class="nav-link dropdown-toggle"
id="navbarDropdownMenuLink"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"><?= $item->translation->name ?></a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink"> <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<?php $children = $item->children; ?> <?php $children = $item->children; ?>
<?php foreach ($children as $child): ?> <?php foreach ($children as $child): ?>
<a <?= $child->target ? 'target="'.$child->target.'"' : '' ?> class="dropdown-item" href="<?= $child->url ?>"><?= $child->name ?></a> <a <?= $child->target ? 'target="' . $child->target . '"' : '' ?> class="dropdown-item"
href="<?= $child->url ?>"><?= $child->translation->name ?></a>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php elseif ($item->parent_id == 0): ?> <?php elseif ($item->parent_id == 0): ?>
<a <?= $item->target ? 'target="'.$item->target.'"' : '' ?> href="<?= $item->getUrl() ?>" class="nav-link"><?= $item->translation->name ?></a> <a <?= $item->target ? 'target="' . $item->target . '"' : '' ?> href="<?= $item->getUrl() ?>"
class="nav-link"><?= $item->translation->name ?></a>
<?php endif; ?> <?php endif; ?>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>

Loading…
Cancel
Save