drupalprojects / kalatheme

Mirror of http://drupal.org/project/kalatheme provided by hubdrop.
http://hubdrop.org/project/kalatheme
GNU General Public License v2.0
22 stars 29 forks source link

Convert kalatheme_links__system_secondary_menu #277

Open labboy0276 opened 8 years ago

labboy0276 commented 8 years ago

Reference: https://www.drupal.org/node/1354#themepreprocess

Convert kalatheme_links__system_secondary_menu in includes/menu.inc to template_preprocess_menu__secondary(&$variables) in KalathemeBootstrap Class (John added placeholder it to the interface):

Add in menu--secondary.html.twig

The theming in the menu system is a little different and this seems to be right based on John's research. If not, just correct it to the way that wins.

Also there is some residual code for this in kalatheme_preprocess_page (move to preprocess):

  // Prepare the secondary_nav
  $sec_attributes = array(
    'id' => 'secondary-menu-links',
    'class' => array('nav', 'navbar-nav', 'secondary-links'),
  );
  if (!$variables['secondary_menu']) {
    $sec_attributes['class'][] = 'sr-only';
  }
  $variables['secondary_nav'] = array(
    '#theme' => 'links__system_secondary_menu',
    '#links' => $variables['secondary_menu'],
    '#attributes' => $sec_attributes,
    '#heading' => array(
      'text' => t('Secondary menu'),
      'level' => 'h2',
      'class' => array('sr-only'),
    ),
  );