function template_preprocess_field_group_html_element in Field Group 8
Same name and namespace in other branches
- 8.3 templates/theme.inc \template_preprocess_field_group_html_element()
Prepares variables for fieldgroup html element templates.
Default template: field-group-html-element.html.twig.
Parameters
array $variables: An associative array containing:
- element: An associative array containing the properties and children of the html element.
File
- templates/
theme.inc, line 80 - Preprocessors for fieldgroup elements.
Code
function template_preprocess_field_group_html_element(&$variables) {
$element = $variables['element'];
if (!empty($element['#title']) && !empty($element['#title_element'])) {
$variables['title_element'] = $element['#title_element'];
$variables['title'] = $element['#title'];
}
$variables['collapsible'] = !empty($element['#effect']) && $element['#effect'] !== 'none';
$variables['wrapper_element'] = $element['#wrapper_element'];
$variables['attributes'] = $element['#attributes'];
$variables['children'] = !empty($element['#children']) ? $element['#children'] : '';
}