I need a list of main menu item links to display on a page (sort of a sitemap). How would I accomplish this in Drupal 7?

closed as too broad by kiamlaluno Jun 9 '17 at 8:40

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

   $menu = menu_navigation_links('main-menu');
   print theme('links__menu_main_page', array('links' => $menu));

Write This code where you want to display menu.

Or you can assign menu block to a region and can call that region like this

print render($page['menu_block']); 
  • Thanks! This is good as well, but I get only the top level items, is there any way to get an array of all top level items and it's children? – Srdjan Marjanovic Jul 23 '14 at 12:53
  • Print render(menu_block_view('main-menu')) – TBI Infotech Jul 24 '14 at 5:20

Go to admin/structure/block and configure the Main Menu block

enter image description here

You want to go further you can Install Menu block module

So… have you ever used the Main and Secondary menu links feature on your theme and wondered “how the hell do I display any menu items deeper than that?”

Well, that’s what this module does. It provides configurable blocks of menu trees starting with any level of any menu. And more!

Not the answer you're looking for? Browse other questions tagged or ask your own question.