fix active hierarchy in menu and megamenu
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
<a class="green-dark @if (($category['id'] ?? false) == $menu_children['id']) active @endif" href="{{ route('Shop.Categories.show', ['id' => $menu_children['id']]) }}">
|
||||
<div class="w-100"><strong>{{ $menu_children['name'] }}</strong></div>
|
||||
<a class="green-dark" href="{{ route('Shop.Categories.show', ['id' => $menu_children['id']]) }}">
|
||||
<div class="w-100 @if (in_array($menu_children['id'], [$category['id'], $category['parent_id']])) active @endif">
|
||||
<strong>{{ $menu_children['name'] }}</strong>
|
||||
</div>
|
||||
</a>
|
||||
@foreach ($menu_children['children'] ?? [] as $leaf)
|
||||
<a class="green-dark @if (($category['id'] ?? false) == $leaf['id']) active @endif" href="{{ route('Shop.Categories.show', ['id' => $leaf['id']]) }}">
|
||||
<div class="w-100">{{ $leaf['name'] }}</div>
|
||||
<a class="green-dark" href="{{ route('Shop.Categories.show', ['id' => $leaf['id']]) }}">
|
||||
<div class="w-100 @if (($category['id'] ?? false) == $leaf['id']) active @endif">{{ $leaf['name'] }}</div>
|
||||
</a>
|
||||
@endforeach
|
||||
|
||||
Reference in New Issue
Block a user