2

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?

2

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();
  • Should i use hook_form_Alter in theme-settings.php or template.php? – Yalamber May 24 '11 at 16:00
  • pastie.org/1966956 this is not working – Yalamber May 24 '11 at 16:39
  • I found out we are not able to do it in theme we can do it from a module though. – Yalamber May 24 '11 at 18:18
0

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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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