Create custom "parent" menu (which appears on admin/structure/menu)

Public

This snippet shows how to create "parent" menu which appears on admin/structure/menu and blocks administration page.

cool.module

</> CopyGet raw version
php
  1. /**
  2.  * Implements hook_menu().
  3.  */
  4. function cool_menu() {
  5. //Add menu items to our cool menu
  6. $items['cool/menu'] = array(
  7. // (...)
  8. 'type' => MENU_NORMAL_ITEM,
  9. 'menu_name' => 'coolmenu',
  10. );
  11.  
  12. return $items;
  13. }

cool.install

</> CopyGet raw version
php
  1. /**
  2.  * Implements hook_enable().
  3.  */
  4. function cool_enable() {
  5. $t = get_t();
  6.  
  7. // Create a custom menu, if Menu module is enabled.
  8. if (module_exists('menu')) {
  9. $menu = array(
  10. 'menu_name' => 'coolmenu',
  11. 'title' => t('Cool Menu'),
  12. 'description' => t('Cool menu example'),
  13. );
  14. menu_save($menu);
  15. }
  16. }