When optimizing your cms for webmasters, you should always install the menu_admin_per_menu module to make sure your webmaster doesn't get access to non-related menus. Personally, I like to not giving access to the admin/structure path as well but to provide a direct link to the edit form of the menu in the toolbar. This snippet shows you how to do it. The tricky part is to add a route parameter to the entry in your mymodule.links.menu.yml:

  title: 'Main menu'
  route_name: entity.menu.edit_form
  route_parameters: { menu: 'main' }
  parent: system.admin
  weight: 90





Saved you some valuable time?


Donate and get more free time-saving code on this website in the future.