Could I use sub-navigation in filament-page? #10073
Replies: 5 comments 3 replies
-
This would be a nice feature for the Settings page (for example). |
Beta Was this translation helpful? Give feedback.
-
Definitively |
Beta Was this translation helpful? Give feedback.
-
Totally agree. This is a much needed feature for custom pages |
Beta Was this translation helpful? Give feedback.
-
Maybe try this: https://filamentphp.com/plugins/aymanalhattami-page-with-sidebar |
Beta Was this translation helpful? Give feedback.
-
You can do this: public function getSubNavigation(): array
{
return $this->generateNavigationItems([
Page::class,
Page::class,
...
]);
} This will take all the navigation settings of the Page as used by getNavigationItems() of the Page-class. Or you can do this: public function getSubNavigation(): array
{
return [
NavigationGroup::make('group')
->items([
NavigationItem::make(Page::class::getNavigationLabel())
->icon(Pages::class::getNavigationIcon())
->isActiveWhen(fn (): bool => request()->routeIs(Page::class::getNavigationItemActiveRoutePattern()))
->url(Page::class::getNavigationUrl()),
])
];
} to build your own custom subnavigation with the settings you want. |
Beta Was this translation helpful? Give feedback.
-
https://filamentphp.com/docs/3.x/panels/resources/getting-started#resource-sub-navigation
Beta Was this translation helpful? Give feedback.
All reactions