Like it was said in subject, how would I do that?
I need to create menu items once after module install and have the ability to edit them if needed.
module.link.menu.yml won't give me that ability.
Anybody have suggestions?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
You can use hook_menu_links_discovered_alter() to modify or add additional links to those provided in *.menu.links.yml files, but these types of links are not completely editable (e.g. you can not change their title in the UI).
If your links are content based, need to be completely editable later through the UI, or are being placed in a custom menu you can directly create the menu link entities:
MenuLinkContent::create([ 'title' => 'My internal link from a route name', 'link' => ['uri' => 'route:myroute'], 'menu_name' => 'my-menu', ])->save();