8.5.x menu.api.php hook_system_breadcrumb_alter(\Drupal\Core\Breadcrumb\Breadcrumb &$breadcrumb, \Drupal\Core\Routing\RouteMatchInterface $route_match, array $context)
8.0.x menu.api.php hook_system_breadcrumb_alter(\Drupal\Core\Breadcrumb\Breadcrumb &$breadcrumb, \Drupal\Core\Routing\RouteMatchInterface $route_match, array $context)
8.1.x menu.api.php hook_system_breadcrumb_alter(\Drupal\Core\Breadcrumb\Breadcrumb &$breadcrumb, \Drupal\Core\Routing\RouteMatchInterface $route_match, array $context)
8.2.x menu.api.php hook_system_breadcrumb_alter(\Drupal\Core\Breadcrumb\Breadcrumb &$breadcrumb, \Drupal\Core\Routing\RouteMatchInterface $route_match, array $context)
8.3.x menu.api.php hook_system_breadcrumb_alter(\Drupal\Core\Breadcrumb\Breadcrumb &$breadcrumb, \Drupal\Core\Routing\RouteMatchInterface $route_match, array $context)
8.4.x menu.api.php hook_system_breadcrumb_alter(\Drupal\Core\Breadcrumb\Breadcrumb &$breadcrumb, \Drupal\Core\Routing\RouteMatchInterface $route_match, array $context)
8.6.x menu.api.php hook_system_breadcrumb_alter(\Drupal\Core\Breadcrumb\Breadcrumb &$breadcrumb, \Drupal\Core\Routing\RouteMatchInterface $route_match, array $context)

Perform alterations to the breadcrumb built by the BreadcrumbManager.

Parameters

\Drupal\Core\Breadcrumb\Breadcrumb $breadcrumb: A breadcrumb object returned by BreadcrumbBuilderInterface::build().

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match.

array $context: May include the following key:

Related topics

1 function implements hook_system_breadcrumb_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

menu_ui_system_breadcrumb_alter in core/modules/menu_ui/menu_ui.module
Implements hook_system_breadcrumb_alter().

File

core/lib/Drupal/Core/Menu/menu.api.php, line 432
Hooks and documentation related to the menu system and links.

Code

function hook_system_breadcrumb_alter(\Drupal\Core\Breadcrumb\Breadcrumb &$breadcrumb, \Drupal\Core\Routing\RouteMatchInterface $route_match, array $context) {

  // Add an item to the end of the breadcrumb.
  $breadcrumb
    ->addLink(\Drupal\Core\Link::createFromRoute(t('Text'), 'example_route_name'));
}