This link https://www.drupal.org/node/2122201 suggest us to make use of route_callbacks when we are using dynamic routes.Can someone tell me how to make use of this route name in *.links.menu.yml file to make menu? The problem is when we are returning $route_collection in the routes() function then it must be containing multiple routes then how to generate menu for any particular dynamic route. I did a search inside menu_tree table in the database and find out that no menu has been created with help of dynamic routes so I am beginning to think whether this is possible or not. If it is not possible that what is the possible solution?

  • I think actually this a follow up question of the previous question because over here I am asking about menus.If you still think we can close this question and I can ask this question over there. Commented May 15, 2015 at 9:55
  • I know my problem always revolves around routes everytime but I guess I can't really stop posting about them because I still have not got solution to my problem. Please help me in this question related to route_callbacks(). Commented May 15, 2015 at 9:57
  • In context of the "original" question, you can always use hook_entity_insert to create appropriate menu link. That's how it's done in D7 too.
    – user21641
    Commented May 15, 2015 at 10:48

1 Answer 1


You need a derivative plugin, see views module for an example, it dynamically generates menu links for views configured to have a menu entry


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