function umami_preprocess_block
Same name in other branches
- 9 core/profiles/demo_umami/themes/umami/umami.theme \umami_preprocess_block()
- 10 core/profiles/demo_umami/themes/umami/umami.theme \umami_preprocess_block()
- 11.x core/profiles/demo_umami/themes/umami/umami.theme \umami_preprocess_block()
Implements hook_preprocess_block().
File
-
core/
profiles/ demo_umami/ themes/ umami/ umami.theme, line 47
Code
function umami_preprocess_block(&$variables) {
$variables['title_attributes']['class'][] = 'block__title';
// Add a class indicating the custom block bundle.
if (isset($variables['elements']['content']['#block_content'])) {
$variables['attributes']['class'][] = Html::getClass('block-type-' . $variables['elements']['content']['#block_content']->bundle());
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.