F
Filament11mo ago
harps

Where to override isActiveWhen()

I have a scenario where I have a resource with routes as so, surveys/pipes {resource list} surveys/pipes/new {new resource} I have them in the navigation in a custom navigation group and I have also added surveys/pipes/new to the nav. The issue is that when I'm on this route surveys/pipes/new both surveys/pipes and surveys/pipes/new show as active in the menu. I think this happens because routeIs returns true in the getNavigationItems function in the parent page class of list records I have tried adding a getNavigationItems function in the list items page resource but it doesn't call it. How do I change the isActiveWhen for a menu item that is generated from the the page class that extends listecords ?
No description
2 Replies
ConnorHowell
ConnorHowell11mo ago
How are you registering the additional page? That's when you want to override it. Also take a look at getNavigationItems on the parent Resource class to see how they're auto registered if you're not doing it manually
harps
harpsOP11mo ago
The page is registered in the resource with getPages(); the page extends ListRecords but there is no getNavigationItems in that class. The getNavigationItems function is in the page class which ListRecords extends. Copying the function from the page class into my page class doesn't seem to do anything.
Want results from more Discord servers?
Add your server