Skip to content

Instantly share code, notes, and snippets.

@wadmiraal
Created November 25, 2013 12:49
Show Gist options
  • Save wadmiraal/7640763 to your computer and use it in GitHub Desktop.
Save wadmiraal/7640763 to your computer and use it in GitHub Desktop.
<?php
function THEMENAME_preprocess_page(&$variables) {
// Get the entire main menu tree
$main_menu_tree = menu_tree_all_data('main-menu', NULL, 3); // Provide max-depth.
// Add the rendered output to the $main_menu_expanded variable
$variables['main_menu_expanded'] = menu_tree_output($main_menu_tree);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment