function umami_preprocess_block

Same name in other branches
  1. 9 core/profiles/demo_umami/themes/umami/umami.theme \umami_preprocess_block()
  2. 8.9.x core/profiles/demo_umami/themes/umami/umami.theme \umami_preprocess_block()
  3. 10 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 54

Code

function umami_preprocess_block(&$variables) {
    $variables['title_attributes']['class'][] = 'block__title';
    // Add a class indicating the content 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.