function ShortcutThemeHooks::preprocessBlock

Implements hook_preprocess_HOOK() for block templates.

Attributes

#[Hook('preprocess_block')]

File

core/modules/shortcut/src/Hook/ShortcutThemeHooks.php, line 20

Class

ShortcutThemeHooks
Hook implementations for shortcut.

Namespace

Drupal\shortcut\Hook

Code

public function preprocessBlock(&$variables) : void {
  if ($variables['configuration']['provider'] == 'shortcut') {
    $variables['attributes']['role'] = 'navigation';
  }
}

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