Hey there,
I’d like to use the pages uuids as reference in the panel menu. Currently I have the following syntax for highlighted menu entries. But if the user currently changes the url of the page, the navigation will break. Any ideas?
'menu' => [
'site' => [
'label' => 'Hauptbereich',
'icon' => 'dashboard',
'current' => function (string $current): bool {
$path = Kirby::instance()->request()->path()->toString();
return $current === 'site'
&& Str::contains($path, 'pages/galleries') === false
&& Str::contains($path, 'pages/uber-uns') === false
&& Str::contains($path, 'pages/podcasts') === false
;
},
],
'galleries' => [
'label' => 'Galerien',
'link' => 'pages/galleries/',
'icon' => 'image',
'current' => function (string $current): bool {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/galleries');
}
],
'-',
'podcasts' => [
'label' => 'Podcasts',
'link' => 'pages/podcasts',
'icon' => 'audio',
'current' => function (string $current): bool {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/podcasts');
}
],
'about-us' => [
'label' => 'Über uns',
'link' => 'pages/uber-uns',
'icon' => 'user',
'current' => function (string $current): bool {
$path = Kirby::instance()->request()->path()->toString();
return Str::contains($path, 'pages/uber-uns');
}
],