-
Notifications
You must be signed in to change notification settings - Fork 29
Extending the menu
Josh edited this page Sep 2, 2015
·
2 revisions
The main menu for Kalatheme is set to load only two levels deep via this code in kalatheme_process_page():
// 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);
This is suitable for most people however in some specific cases it may be useful to extend this.
In order to do this in your sub theme implement hook_process_page() like so:
/**
* Implements hook_preprocess_page.
*/
function *your_theme_name*_process_page(&$vars){
// Make our menu deeper.
$depth = 4;
$main_links_menu = variable_get('menu_main_links_source', 'main-menu');
$main_menu_tree = menu_tree_all_data($main_links_menu, NULL, $depth);
}
Just change $depth to the depth you require and voila!
- Home
- Quickstarts
- Setup and Installation
- Configuring Server for automatic subtheme installation
- Manual Installation
- Using Custom Bootstrap Libraries
- Installation with Drush
- Using Kalatheme and Best Practices
- Kalatheme Settings and Configuration
- Responsive Toggling
- Styles Plugin
- Dynamic Grid System
- Theming with One Region
- Panels Layouts
- Tips, Tricks, and Frequently Asked Questions
- Kalatheme 4.x Roadmap
- Participating
- Test Bed