bef85eb22f4a1cddd55d2bcdfb98613e309cf2e5
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / menu_breadcrumb_alter.twig
1 /**
2  * Implements hook_menu_breadcrumb_alter().
3  */
4 function {{ machine_name }}_menu_breadcrumb_alter(&$active_trail, $item) {
5   // Always display a link to the current page by duplicating the last link in
6   // the active trail. This means that menu_get_active_breadcrumb() will remove
7   // the last link (for the current page), but since it is added once more here,
8   // it will appear.
9   if (!drupal_is_front_page()) {
10     $end = end($active_trail);
11     if ($item['href'] == $end['href']) {
12       $active_trail[] = $end;
13     }
14   }
15 }