You are here

function seven_preprocess_menu_local_tasks in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/themes/seven/seven.theme \seven_preprocess_menu_local_tasks()

Implements hook_pre_render_HOOK() for menu-local-tasks templates.

Use preprocess hook to set #attached to child elements because they will be processed by Twig and drupal_render will be invoked.

File

core/themes/seven/seven.theme, line 32
Functions to support theming in the Seven theme.

Code

function seven_preprocess_menu_local_tasks(&$variables) {
  if (!empty($variables['primary'])) {
    $variables['primary']['#attached'] = array(
      'library' => array(
        'seven/drupal.nav-tabs',
      ),
    );
  }
  elseif (!empty($variables['secondary'])) {
    $variables['secondary']['#attached'] = array(
      'library' => array(
        'seven/drupal.nav-tabs',
      ),
    );
  }
}