@php $cpItem = (array) ($item ?? []); $cpLevel = (int) ($level ?? 0); $cpChildren = array_values((array) data_get($cpItem, 'children', [])); $cpUrl = trim((string) data_get($cpItem, 'url', '#')) ?: '#'; $cpTitle = trim((string) data_get($cpItem, 'title', 'Menu')) ?: 'Menu'; $cpTarget = (string) data_get($cpItem, 'target', '_self'); $cpCurrent = (string) ($currentUrl ?? ''); $cpComparable = rtrim($cpUrl, '/'); $cpActive = $cpComparable !== '' && $cpComparable !== '#' && ($cpCurrent === $cpComparable || str_starts_with($cpCurrent.'/', $cpComparable.'/')); $cpHasChildren = $cpChildren !== []; @endphp
  • 0) class="cp-submenu-link" @elseif($cpHasChildren) class="dropdown-toggle" data-toggle="dropdown" role="button" @endif @if($cpHasChildren) aria-haspopup="true" aria-expanded="false" @endif @if($cpComparable === $cpCurrent && $cpComparable !== '#') aria-current="page" @endif> @if($cpLevel > 0) {{ $cpTitle }} @else {{ $cpTitle }} @if($cpHasChildren)@endif @endif @if($cpHasChildren) {{-- Preserve the working critical paint fallback. Styling only decorates this panel; it never animates its opacity or moves it behind the hero. --}} @endif