function umami_preprocess_block__bundle__banner_block

Same name and namespace in other branches
  1. 11.x core/profiles/demo_umami/themes/umami/umami.theme \umami_preprocess_block__bundle__banner_block()

Implements hook_umami_preprocess_block__bundle__banner_block().

File

core/profiles/demo_umami/themes/umami/umami.theme, line 75

Code

function umami_preprocess_block__bundle__banner_block(&$variables) {
  if (isset($variables['content']['field_content_link'])) {
    foreach (Element::children($variables['content']['field_content_link']) as $key) {
      $variables['content']['field_content_link'][$key]['#attributes']['class'][] = 'button';
      $variables['content']['field_content_link'][$key]['#attributes']['class'][] = 'button--primary';
      $variables['content']['field_content_link'][$key]['#attributes']['class'][] = 'banner__button';
    }
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.