Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert kalatheme_links__system_main_menu #276

Open
labboy0276 opened this issue Jun 9, 2016 · 0 comments
Open

Convert kalatheme_links__system_main_menu #276

labboy0276 opened this issue Jun 9, 2016 · 0 comments
Assignees
Milestone

Comments

@labboy0276
Copy link

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

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

Add in menu--main.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):

  // Get the menu tree for the menu that is set as 'Source for the Main links'.
  $main_links_menu = variable_get('menu_main_links_source', 'main-menu');
  $main_menu_tree = menu_tree_all_data($main_links_menu, NULL, 2);

  // Add the rendered output to the $main_menu_expanded variable.
  $main_menu_expanded = menu_tree_output($main_menu_tree);

  // Prepare the primary_nav
  $pri_attributes = array(
    'class' => array(
      'nav',
      'navbar-nav',
      'links',
      'clearfix',
    ),
  );
  if (!$variables['main_menu']) {
    $pri_attributes['class'][] = 'sr-only';
  }
  $variables['primary_nav'] = array(
    '#theme' => 'links__system_main_menu',
    '#links' => $main_menu_expanded,
    '#attributes' => $pri_attributes,
    '#heading' => array(
      'text' => t('Main menu'),
      'level' => 'h2',
      'class' => array('sr-only'),
    ),
  );

@labboy0276 labboy0276 added this to the 8.x-alpha milestone Jun 9, 2016
@soniktrooth soniktrooth added Epic and removed Epic labels Jun 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants