function MenuUiThemeHooks::preprocessBlock

Implements hook_preprocess_HOOK() for block templates.

Attributes

#[Hook('preprocess_block')]

File

core/modules/menu_ui/src/Hook/MenuUiThemeHooks.php, line 15

Class

MenuUiThemeHooks
Hook implementations for menu_ui.

Namespace

Drupal\menu_ui\Hook

Code

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

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