TanchoToplineCargo/resources/views/client/sunsari/nav.blade.php
2024-05-05 10:32:49 +05:45

46 lines
2.1 KiB
PHP

<div class="main-nav">
<div class="container">
<nav id="navigation1" class="navigation">
<div class="nav-header">
<a class="nav-logo" href="{{ site_url() }}">
<img src="{{ site_url(SITEVARS->primary_logo) }}" class="white-logo" alt="">
<img src="{{ site_url(SITEVARS->secondary_logo) }}" class="dark-logo" alt="">
</a>
<div class="nav-toggle"></div>
</div>
<div class="nav-menus-wrapper">
<ul class="nav-menu align-to-right">
@php
$menuItems = MPCMS::getMenuItems('header-menu');
@endphp
@foreach ($menuItems as $menuItem)
@php
$menuItem->alias = str_replace('-', '_', $menuItem->alias);
$routeName = $menuItem->alias;
$routeUrl = route($routeName);
@endphp
<li>
@if (!empty($menuItem->children))
<a href="#">{{ $menuItem->title }}</a> <!-- Parent item is unclickable -->
<ul class="nav-dropdown">
@foreach ($menuItem->children as $menu)
@php
$menuRouteName = $menuItem->alias . '.' . $menu->alias;
$menuRouteUrl = route($menuRouteName);
@endphp
<li><a href="{{ $menuRouteUrl }}">{{ $menu->title }}</a></li>
@endforeach
</ul>
@else
<a href="{{ $routeUrl }}">{{ $menuItem->title }}</a> <!-- Regular clickable item -->
@endif
</li>
@endforeach
</ul>
</div>
</nav>
</div>
</div>