FilamentF
Filament2y ago
CGM

Moving Sub-Navigation Elements to Main Sidebar as Child Elements

I've been working on integrating a new Relation Page into our project, following the guide in the docs (https://filamentphp.com/docs/3.x/panels/resources/relation-managers#relation-pages).

However, I'm struggling to get the sub-navigation to our standard sidebar instead of in the content pane. I've been using the getRecordSubNavigation() method to generate the navigation items, as shown below:

    public static function getRecordSubNavigation(Page $page): array
    {
        return $page->generateNavigationItems([
            Pages\ViewLocation::class,
            Pages\ManageReviewSites::class,
        ]);
    }


The Pages\ManageReviewSites::class represents our Relation Page. What I'm aiming for is to have this 'sub-navigation' appear in the main sidebar instead when its parent page is accessed.

I've attempted to modify the protected static SubNavigationPosition $subNavigationPosition, but my only options are top/start/end, nothing that indicates moving it to the main sidebar.

I feel like getRecordSubNavigation() isn't the correct way to accomplish this.

The attached screenshot kind of shows what I'm hoping to accomplish.
image.png
Solution
Have you try register custom navigation ?
IMG_3754.png
Was this page helpful?