Created
May 7, 2015 10:49
-
-
Save rang501/630c60c8bff10dc98864 to your computer and use it in GitHub Desktop.
better main menu with bootstrap theme.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_theme_preprocess_page(&$variables) { | |
if ($variables['main_menu']) { | |
// Build links. | |
$links_source = variable_get('menu_main_links_source', 'main-menu'); | |
$tree = menu_tree_all_data($links_source, NULL, 1); | |
menu_tree_add_active_path($tree); | |
$variables['primary_nav'] = menu_tree_output($tree); | |
// Provide default theme wrapper function. | |
$variables['primary_nav']['#theme_wrappers'] = array('menu_tree__primary'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment