You are here

function bibcite_entity_theme_suggestions_bibcite_contributor in Bibliography & Citation 8

Same name and namespace in other branches
  1. 2.0.x modules/bibcite_entity/bibcite_entity.module \bibcite_entity_theme_suggestions_bibcite_contributor()

Implements hook_theme_suggestions_bibcite_contributor().

File

modules/bibcite_entity/bibcite_entity.module, line 229
Module hooks.

Code

function bibcite_entity_theme_suggestions_bibcite_contributor(array $variables) {
  $suggestions = [];

  /** @var EntityInterface $entity */
  $entity = $variables['elements']['#bibcite_contributor'];
  $sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
  $suggestions[] = 'bibcite_contributor__' . $sanitized_view_mode;
  $suggestions[] = 'bibcite_contributor__' . $entity
    ->id();
  $suggestions[] = 'bibcite_contributor__' . $entity
    ->id() . '__' . $sanitized_view_mode;
  return $suggestions;
}