F
Filament11mo ago
Prodex

Sub Navigation in ListView for Custom Page

Hi, I want to display a sub navigation in the ListView for a custom page (which does not interact with any record). I have a subnavigation for my records setup already in my CustomerResource:
public static function getRecordSubNavigation(Page $page): array
{
return $page->generateNavigationItems([
Pages\Overview::class,
Pages\Projects::class,
]);
}

public static function getPages(): array
{
return [
'index' => Pages\ListCustomers::route('/'),
'overview' => Pages\Overview::route('/{record}'),
'projects' => Pages\Projects::route('/{record}/projects'),
];
}
public static function getRecordSubNavigation(Page $page): array
{
return $page->generateNavigationItems([
Pages\Overview::class,
Pages\Projects::class,
]);
}

public static function getPages(): array
{
return [
'index' => Pages\ListCustomers::route('/'),
'overview' => Pages\Overview::route('/{record}'),
'projects' => Pages\Projects::route('/{record}/projects'),
];
}
But how can I display a sub navigation on the ListCustomers Page for a custom Page? Thank you!
3 Replies
NolanN
NolanN5mo ago
Curious if this was ever solved...
Prodex
ProdexOP5mo ago
yes, Filament introduced "clusters" after this issue, which solves the problem by just using them instead of the RecordSubNavigation method. https://filamentphp.com/docs/3.x/panels/clusters
NolanN
NolanN5mo ago
Unfortunately that isn't the ideal situation in my case. I've used clusters some but I have a resource with several ManageRelatedRecords pages. I was hoping to just add a single page to the sub nav or, even more ideal, add a cluster into it but it doesn't look like that can be done. I know that I could rework my existing resource to a cluster but that simply isn't worth the effort at this point
Want results from more Discord servers?
Add your server