function olivero_preprocess_menu

Same name in other branches
  1. 9 core/themes/olivero/olivero.theme \olivero_preprocess_menu()
  2. 10 core/themes/olivero/olivero.theme \olivero_preprocess_menu()

Implements hook_preprocess_HOOK().

File

core/themes/olivero/olivero.theme, line 174

Code

function olivero_preprocess_menu(&$variables) {
    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.