function UmamiHooks::themeSuggestionsBlockAlter

Same name and namespace in other branches
  1. 11.x core/profiles/demo_umami/themes/umami/src/Hook/UmamiHooks.php \Drupal\umami\Hook\UmamiHooks::themeSuggestionsBlockAlter()

Implements hook_theme_suggestions_HOOK_alter() for block templates.

Attributes

#[Hook('theme_suggestions_block_alter')]

File

core/profiles/demo_umami/themes/umami/src/Hook/UmamiHooks.php, line 69

Class

UmamiHooks
Hook implementations for umami.

Namespace

Drupal\umami\Hook

Code

public function themeSuggestionsBlockAlter(array &$suggestions, array $variables) : void {
  // Block suggestions for content block bundles.
  if (isset($variables['elements']['content']['#block_content'])) {
    array_splice($suggestions, 1, 0, 'block__bundle__' . $variables['elements']['content']['#block_content']->bundle());
  }
}

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