Created
September 25, 2012 01:31
-
-
Save danreb/3779462 to your computer and use it in GitHub Desktop.
Example code for overriding specific menu in Drupal 7 using theme_menu_tree()
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
<?php | |
/** | |
* Implements hook_menu_tree | |
* Wrap main menu with 2 division (Bootstrap) | |
* | |
*/ | |
function speedy_menu_tree__main_menu($vars) { | |
return '<div class="navbar"><div class="navbar-inner"><ul class="nav">' . $vars['tree'] . '</ul></div></div>'; | |
} | |
/** | |
* Implements hook_menu_tree | |
* Remove class for user menu | |
* | |
*/ | |
function speedy_menu_tree__user_menu($vars) { | |
return '<ul>' . $vars['tree'] . '</ul>'; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please note, the word speedy in my function name is the name of my theme. Make sure to replace that with the correct name, this examples uses theme_menu_tree() function.