function OliveroHooks::preprocessMenu
Same name and namespace in other branches
- 11.x core/themes/olivero/src/Hook/OliveroHooks.php \Drupal\olivero\Hook\OliveroHooks::preprocessMenu()
Implements hook_preprocess_HOOK() for menu.
Attributes
#[Hook('preprocess_menu')]
File
-
core/
themes/ olivero/ src/ Hook/ OliveroHooks.php, line 144
Class
- OliveroHooks
- Hook implementations for olivero.
Namespace
Drupal\olivero\HookCode
public function preprocessMenu(&$variables) : void {
if (isset($variables['attributes']['region'])) {
if ($variables['attributes']['region'] === 'sidebar') {
$variables['attributes']['class'][] = 'menu--sidebar';
}
unset($variables['attributes']['region']);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.