In Drupal 7, in admin/structure/menu/settings we have the main links and the secondary links.
Can we add third one here? Is there any way to get the list of all menus created in backend?
Can we add third one here?
Yes, we can. Use hook_form_alter()
, alter form_id menu_configure
.
How do I know what form_id? Let's see menu_menu()
at http://api.drupal.org/api/drupal/modules--menu--menu.module/function/menu_menu/7
Is there any way to get the list of all menus created in backend?
Again, We can. Select menus in table {menu_links} where {menu_links}.menu_name = management.
$result = db_select('menu_links', 'm')
->fields('m')
->condition('menu_name', 'management','=')
->execute()
->fetchAssoc();
On the "Menus" menu, you can select "Add new Menu" in the upper part of the window. Once added, you can go to "Blocks" to select where that new menu will be.
Also on "Menus" you can see all menus in your site (Main, Navigation and user-created)