-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a weight system to order items on the same branch #97
Comments
I'm guessing the tree is rendered recursively which mean we either need to sort the |
+1. Would like to order when using listeners. |
Oh and, actually i'm 👍 with this. |
Hi all! Any news on the issue? |
SOLUTION$item->reorderChildren([
'child_name_1',
'child_name_2',
'child_name_3',
'child_name_4',
]); |
I was looking for this for the last 4 years... |
@Maxwell2022 I found that method occasionally) Array items are names you give to the menu's children. |
It would be great to add an optional weight for the items of the menu. This weight would be used when rendering the menu to order the items located in the same level of the tree.
I know that at the moment if I want an item at the end of the list I have to add it last. But it would simplify a lot of logic in the code if we could use a weight system.
ie. you want to display 5 menu items depending of the user role:
without weight system:
with a weight system:
I had a look to the options and could not find it so I guess it's not been implemented for now but I'll be happy to know that I'm wrong :)
Cheers,
Maxime
The text was updated successfully, but these errors were encountered: