Implementing tabs that changes the whole page
How do I implement a tab that will change the whole page and set the url?
The current setup of that is that you can click multiple tabs without affecting the url.
In my case I have a lots of tabs and some tabs contains tables and I don't want the page to load all the contents of those tabs in one go as it will severely affect the resource and performance on the server.
Please see the demo
30 Replies
So as you see on the demo the tab is set and it only loaded that contents on the selected tab which is what I wanted to implement here.
Resource sub-navigation is what you're looking for I think
Hi, Morty would it be okay if you could guide me through this?
I've got my own projects I'm working on but if you post in here I'll help when I can.
This is what you're looking for, right?

YES something like that, what happens if you click on the contact, will the whole page reload and load only the the contents inside the "Contacts" Tab?
Yes, it's loading a manage related records page but you can also just do custom pages.

@morty in my current setup do you recommend me to use Resource or Custom pages ?
You can mix-and-match. I can't really answer that for you because I don't know your project. If your tabs will be related records to the resource record then use manage related records pages. Otherwise you might need custom pages.
I added a custom page called
SettingAccountDetails.php
however I have trouble adding this SettingAccountDetails
as a Navigation tab under Setting.php
What should be the right way for calling custom page as a tab?
Please guide me as I am not even sure if I am doing these steps correctly or should I create a Settings Resource instead ?
ya it's sub-resource navigation. Is setting related to the user resource in that screenshot? If not, I think you'd need to create a setting resource.
Some code that might help you:
Why is it when I tried adding a new Resource, the new For example resource SettingResource does not even show on the left side navigation?
as
Setting
?We just solved this in the other thread, right?
Correct
Are these Pages such as
Pages\ListAccounts
, Pages\ViewAccount
, Pages\ManageAccountContacts
Stored on Filement\Pages\...
or Filament\Resources\Pages\...
?@morty I followed your implementation on the navigation but I think I am missing something here in order to display the pages that I wanted under this resource.


I'm not really following your settings example. Resource sub-navigation is done for each record of a resource.
Perhaps you should be putting your sub-nav on the user resource from what it appears you're trying to achieve. Therefore when you click into a user you'd see the sub-nav.
Otherwise, if you're just trying to cluster things then resource sub-navigation is not what you want. Instead you want https://filamentphp.com/docs/3.x/panels/clusters
@morty Unfortunately each tab is not really tied down to the settings model.
I'm using clusters for my categories like so. You can change the position to the top with these too

I will try clusters this time,
The Settings structure in the model is quite different

I watched the video you linked again. From what I gather, this is how it's structured:
There is a
Group
resource. The group that you're working with is called 000 Jeff's Test Group
. Therefore if you want to replicate this in Filament, you'd have a GroupResource
listing and upon clicking into the 000 Jeff's Test Group
record, then the resource subnav would be on that specific record, not the model.Should these tabs still all be inside the Cluster right?


https://demo.filamentphp.com/shop/products/products
The demo app has a cluster demo
And here is the code for that demo site: https://github.com/filamentphp/demo
GitHub
GitHub - filamentphp/demo: Source code for the demo.filamentphp.com...
Source code for the demo.filamentphp.com website. Contribute to filamentphp/demo development by creating an account on GitHub.
I see that categories is under the cluster