In default the ordering of left menu items is in alphabetical order.
My client wants to order those menus manually. Any idea how to make it possible?
Go to answer
In default the ordering of left menu items is in alphabetical order.
My client wants to order those menus manually. Any idea how to make it possible?
Go to answer
Change /nova/resources/navigation.blade.php
{{ $group }}
to following:Now you can easily sort the groups as follows:
or
Attention: You must convert special characters in the title!
With the links, it's a bit other.... First Method: dirty and ugly
You can change
to
Then you can sort the links by the first letter of the resource name.
Or a better Method for Links crate app/Nova/CustomResource.php:
Change /nova/resources/navigation.blade.php
And in the Nova resource, extends this custom resource and You can use public static $label:
Attention: You must convert special characters in the title!
You can do it in
add a method resources() and register the resources manually like
Alternate
There is another way mentioned in this gist, this seems good too, but official documentation has no mention of it yet.
This way you set priority of resource and based on priority you render the resource.
to sort the groups:
add this to your resources:
you can overwrite it by adding it to any member resource to downgrade it's order in the navigation tree:
add this before returning at the end of resourcemanager (i hope i shouldn't have to overwrite this at this place):
A cleaner way and tested on latest Nova 3.x. Also, this has been added to Nova since version 2.10+ All you need to do is add a static property on your nova classes. For example Clients will be:
Then after that you can use the NovaServiceProvider to tell nova to use your custom ordering. You can place the code in the
boot method
**Reference Nova Private Repo
There are two ways to achieve this:
1. Priority Method
2. Ordering Resource models in NovaServiceProvider
In NovaServiceProvider, order Resource models like this:
you can use grouping if that helps. I know it's not a 100% fix but maybe it will help a bit.