I work on an drupal 8 application that use the group module with the restriction of only one group per user. i want to be able to modify the menu items so that the id of the user's group is always in the url. this way i can use views with a group id in the url.

I search and i always go to the same pages with the same example that doesn't work for me.


1 Answer 1


this will not work because the menu are build during the cache clearing, thus the url cannot be dynamic.

i instead use an EventSubscriber on Kernel::REQUEST and redirect the user if need be.

  • this did't work either i made a custom block to handle the menus Feb 19, 2020 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.