2 * Implements hook_contextual_links_alter().
4 function {{ machine_name }}_contextual_links_alter(array &$links, $group, array $route_parameters) {
5 if ($group == 'menu') {
6 // Dynamically use the menu name for the title of the menu_edit contextual
8 $menu = \Drupal::entityManager()->getStorage('menu')->load($route_parameters['menu']);
9 $links['menu_edit']['title'] = t('Edit menu: @label', ['@label' => $menu->label()]);