mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 02:04:03 +00:00
Fix menu links
This commit is contained in:
parent
4175a60f85
commit
478452d1eb
2 changed files with 4 additions and 1 deletions
|
|
@ -43,4 +43,7 @@ return [
|
||||||
'url' => function ($page, $path) {
|
'url' => function ($page, $path) {
|
||||||
return starts_with($path, 'http') ? $path : '/'.trimPath($path);
|
return starts_with($path, 'http') ? $path : '/'.trimPath($path);
|
||||||
},
|
},
|
||||||
|
'isUrl' => function ($page, $path) {
|
||||||
|
return starts_with($path, 'http');
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<li class="list-reset pl-4">
|
<li class="list-reset pl-4">
|
||||||
@if ($url = is_string($item) ? $item : $item->url)
|
@if ($url = is_string($item) ? $item : $item->url)
|
||||||
{{-- Menu item with URL--}}
|
{{-- Menu item with URL--}}
|
||||||
<a href="{{ $page->url($url) ? $url : $page->link($url) }}"
|
<a href="{{ $page->isUrl($url) ? $url : $page->link($url) }}"
|
||||||
class="{{ 'lvl' . $level }} {{ $page->isActiveParent($item) ? 'lvl' . $level . '-active' : '' }} {{ $page->isActive($url) ? 'active font-semibold text-blue' : '' }} nav-menu__item hover:text-blue"
|
class="{{ 'lvl' . $level }} {{ $page->isActiveParent($item) ? 'lvl' . $level . '-active' : '' }} {{ $page->isActive($url) ? 'active font-semibold text-blue' : '' }} nav-menu__item hover:text-blue"
|
||||||
>
|
>
|
||||||
{{ $label }}
|
{{ $label }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue