X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fhook%2Fcontextual_links_alter.twig;fp=vendor%2Fchi-teck%2Fdrupal-code-generator%2Ftemplates%2Fd8%2Fhook%2Fcontextual_links_alter.twig;h=9278ebd83a823358d7ca9995fe7587173c0279d9;hp=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_alter.twig new file mode 100644 index 000000000..9278ebd83 --- /dev/null +++ b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/contextual_links_alter.twig @@ -0,0 +1,11 @@ +/** + * Implements hook_contextual_links_alter(). + */ +function {{ machine_name }}_contextual_links_alter(array &$links, $group, array $route_parameters) { + if ($group == 'menu') { + // Dynamically use the menu name for the title of the menu_edit contextual + // link. + $menu = \Drupal::entityManager()->getStorage('menu')->load($route_parameters['menu']); + $links['menu_edit']['title'] = t('Edit menu: @label', ['@label' => $menu->label()]); + } +}