Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. olivero.theme

function olivero_preprocess_menu

Implements hook_preprocess_HOOK().

File

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

Code

function olivero_preprocess_menu(&$variables) : void {
    if (isset($variables['attributes']['region'])) {
        if ($variables['attributes']['region'] === 'sidebar') {
            $variables['attributes']['class'][] = 'menu--sidebar';
        }
        unset($variables['attributes']['region']);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal