Skip to content
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

Problems with order of the menu items #118

Open
stollr opened this issue Jun 14, 2012 · 1 comment
Open

Problems with order of the menu items #118

stollr opened this issue Jun 14, 2012 · 1 comment

Comments

@stollr
Copy link

stollr commented Jun 14, 2012

Hi,
I am developing an application with modules which should be independent from each other. There is one BaseBundle (or base module) which creates the main menu and every bundle can extend the menu by creating event listeners.

But depending on the permissions of the currently logged in user there are shown more or less menu items.

I will give you an example:

Module 1

defines this menu items:

  • User Management [if logged in and admin] {11000}
  • Logout [if logged in] {80000}
  • Profile [if logged in] {12000}
  • Exit User [if logged in and switched to another user] {90000}

Module 2

defines this menu items:

  • Customer Management [if logged in and customer manager] {12100}
  • Document Management [if logged in] {12200}
    • User Permissions [if logged in and admin]
    • Documents [if logged in]
    • Categories [if logged in]
    • Permission Groups [if logged in and admin]

The above is the order how the menu items are defined.
But they should be shown in another order. The 'Customer Management' item should be shown after 'Profile', followed by the 'Document Management' item and it's children. Then the 'Logout' Link and the 'Exit User' item at last.

I have not found any solution in your documentation.

A possible solution would be to set order offsets to the menu items (like in the curly brackets). But maybe you have a better idea?!

@althaus
Copy link

althaus commented Nov 2, 2015

We'd the same problem and I solved it based on this blog post using a custom orderNumber (like a weighting): http://blog.code4hire.com/2013/06/building-a-menu-in-symfony-with-events-and-ordering/

EmmanuelVella pushed a commit to EmmanuelVella/KnpMenuBundle that referenced this issue Sep 23, 2020
renamed MenuNodeCommon to MenuNodeCommonAdmin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants