You are here

function breadcrumb_extra_field_entity_view in Breadcrumb Extra Field 8

Same name and namespace in other branches
  1. 7 breadcrumb_extra_field.module \breadcrumb_extra_field_entity_view()
  2. 2.x breadcrumb_extra_field.module \breadcrumb_extra_field_entity_view()

Implements hook_entity_view().

File

./breadcrumb_extra_field.module, line 55
Main module file.

Code

function breadcrumb_extra_field_entity_view(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display, $view_mode) {
  if ($display
    ->getComponent('breadcrumb')) {
    $build['breadcrumb'] = Drupal::service('breadcrumb')
      ->build(Drupal::routeMatch())
      ->toRenderable();
  }
}