Drupal - Print custom menu in a tpl file

In this we will see how a custome menu can be called and print in a tpl file.

First find the menu ID/Name, 

Go to Structure -> Menus -> And edit your menu.

Find the menu name in the URL like in my case it was http://www.my-domain.com/admin/structure/menu/manage/menu-search-box-menu/edit 

Then write below code in any of your tpl file,


$search_menu_name = "menu-search-box-menu";

print theme('links', array('links' => menu_navigation_links($search_menu_name), 'attributes' => array('id' => $search_menu_name, 'class'=> array('links', 'inline'))));


This will print your menu.

No comments available.