function template_preprocess_bibcite_contributor in Bibliography & Citation 2.0.x
Same name and namespace in other branches
- 8 modules/bibcite_entity/bibcite_entity.module \template_preprocess_bibcite_contributor()
Prepares variables for contributor templates.
Default template: bibcite-contributor.html.twig.
Parameters
array $variables: An associative array containing:
- elements: An array of elements to display in view mode.
- attributes: HTML attributes for the containing element.
- bibcite_contributor: The contributor object.
- view_mode: View mode.
File
- modules/
bibcite_entity/ bibcite_entity.module, line 254 - Module hooks.
Code
function template_preprocess_bibcite_contributor(array &$variables) {
$variables['view_mode'] = $variables['elements']['#view_mode'];
$variables['bibcite_contributor'] = $variables['elements']['#bibcite_contributor'];
$variables += [
'content' => [],
];
foreach (Element::children($variables['elements']) as $key) {
$variables['content'][$key] = $variables['elements'][$key];
}
$variables['attributes']['class'][] = 'bibcite-contributor';
}