Setting navigation group as collapsed by default
How do I set a navigation group, which is created from the resource AND used by multiple resources, to be collapsed by default?
4 Replies
you can set navigation group in your panel provider and set the group every each resources that you wish. you can refer to this documentation. and add ->collapsed()
@Expecto Patronum I've tried that, but nothing changed.
Just to make sure I understand, I DEFINE the navigation groups inside the panel provider, and remove the navigation group definitions in the resources. I only tell the resources under which navigation group they should belong?
For some reason, I can't get this to work. What change do I need to make in the resources?
Also, whatever group I make via the portal provider, they aren't showing up.
Got it working.. Appearently it only works, if you actually apply a resource to that menu "name"
ty!
Yes
Glad to hear it
Hello, i have to ask again ... i have a similar problem and want to collapse some NavigationGroups on loading ... in my case if i add ->collapsed() nothing changed, i am also using only a AdminPanelProvider for Navigation generation. i checked the NavigationItems with dd() and they get the corret settings - for me, it seems if the are feed back into the builder instance, this setting get completely lost.
foreach($arrNavGroup as $group){
$group->collapsible(true)->collapsed(true);
#dd($group); //collapsible is applied
$builder->group($group);
}
return $builder;
//collapsible flag gone after return
any hint on this?
thanks for any hint guys
i dont understand what you have done .... could you please explain a bit more? thanks
maybe one more thing to mention .... i calll the obove code in $panel->navigation(function (NavigationBuilder $builder): NavigationBuilder {}