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

Issue #8: Respect header menu settings without rendering the whole me… #14

Merged
merged 1 commit into from
Aug 30, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions template.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,15 @@ function radix_preprocess_header(&$variables) {
$search_box = drupal_render($search_box_form);
$variables['search_form'] = (user_access('search content')) ? $search_box : NULL;
}
}

// Format and add specified menu to theme.
$menu = $variables['menu-name'] ? menu_navigation_links($variables['menu-name']) : NULL;
$variables['menu'] = $menu ? theme('links__header_menu', array('links' => $menu, 'attributes' => array('class' => array('menu', 'nav', 'navbar-nav')))) : NULL;
/**
* Implements template_preprocess_links__header_menu().
*/
function radix_preprocess_links(&$variables) {
if ($variables['theme_hook_original'] == 'links__header_menu') {
$variables['attributes']['class'][] = 'menu';
$variables['attributes']['class'][] = 'nav';
$variables['attributes']['class'][] = 'navbar-nav';
}
}