function bibcite_entity_theme_suggestions_bibcite_reference in Bibliography & Citation 8
Same name and namespace in other branches
- 2.0.x modules/bibcite_entity/bibcite_entity.module \bibcite_entity_theme_suggestions_bibcite_reference()
Implements hook_theme_suggestions_bibcite_reference().
File
- modules/
bibcite_entity/ bibcite_entity.module, line 148 - Module hooks.
Code
function bibcite_entity_theme_suggestions_bibcite_reference(array $variables) {
$suggestions = [];
/** @var EntityInterface $entity */
$entity = $variables['elements']['#bibcite_reference'];
$sanitized_view_mode = strtr($variables['elements']['#view_mode'], '.', '_');
$suggestions[] = 'bibcite_reference__' . $sanitized_view_mode;
$suggestions[] = 'bibcite_reference__' . $entity
->bundle();
$suggestions[] = 'bibcite_reference__' . $entity
->bundle() . '__' . $sanitized_view_mode;
$suggestions[] = 'bibcite_reference__' . $entity
->id();
$suggestions[] = 'bibcite_reference__' . $entity
->id() . '__' . $sanitized_view_mode;
return $suggestions;
}