function umami_preprocess_html in Drupal 8
Same name and namespace in other branches
- 9 core/profiles/demo_umami/themes/umami/umami.theme \umami_preprocess_html()
Implements hook_preprocess_HOOK() for HTML document templates.
Adds body classes if certain regions have content.
File
- core/
profiles/ demo_umami/ themes/ umami/ umami.theme, line 17 - Functions to support theming in the Umami theme.
Code
function umami_preprocess_html(&$variables) {
// Add a sidebar class if the sidebar has content in it.
if (!empty($variables['page']['sidebar'])) {
$variables['attributes']['class'][] = 'two-columns';
$variables['#attached']['library'][] = 'umami/two-columns';
}
else {
$variables['attributes']['class'][] = 'one-column';
}
}