function bartik_preprocess_page

Implements hook_preprocess_HOOK() for page.html.twig.

File

drupal/core/themes/bartik/bartik.theme, line 45
Functions to support theming in the Bartik theme.

Code

function bartik_preprocess_page(&$variables) {

  // Pass the main menu and secondary menu to the template as render arrays.
  if (!empty($variables['main_menu'])) {
    $variables['main_menu']['#attributes']['id'] = 'main-menu-links';
    $variables['main_menu']['#attributes']['class'] = array(
      'links',
      'clearfix',
    );
  }
  if (!empty($variables['secondary_menu'])) {
    $variables['secondary_menu']['#attributes']['id'] = 'secondary-menu-links';
  }
}