Skip to main content
Question title does not require editing
Link
Ashlar
  • 5.1k
  • 6
  • 35
  • 56

Drupal Coding - Menus - hook_menu() is not generating menus

edited title
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

Drupal Coding - Menus - hook_menu() is not generating menus

Tweeted twitter.com/#!/StackDrupal/status/179716194868277248
added 22 characters in body
Source Link
Ashlar
  • 5.1k
  • 6
  • 35
  • 56

While working on the layout of a new custom menu, I discovered that the hook_menu process is not working on my D7.12 local site. As a test I enabled the Menu_example module and found that it will not generate menu items in the navigation menu, although it did a week or two ago. So far I have reinstalled all Drupal 7.12 files and confirmed that the module file hook_menus are being read (using dsm). I am at a loss as to what else can be preventing the menu links from being installed.

Does anyone have any similar experiences or suggestions on how to track this problem down to its source?

EDIT: This code does not add a menu item in an empty menu called "Stuff":

function material_menu_menu (){
  $items['stuff/existing'] = array(
    'title' => '020000 Existing', 
    'page callback' => 'material_view' , 
    'page arguments' => array ('sum' , '020000 '), 
    'type' => MENU_NORMAL_ITEM, 
    'menu_name' => 'Stuff',   
    'access callback' => TRUE,
    'weight' => '2 ');
  return $items;
}

While working on the layout of a new custom menu, I discovered that the hook_menu process is not working on my D7.12 local site. As a test I enabled the Menu_example module and found that it will not generate menu items in the navigation menu, although it did a week or two ago. So far I have reinstalled all Drupal 7.12 files and confirmed that the module file hook_menus are being read (using dsm). I am at a loss as to what else can be preventing the menu links from being installed.

Does anyone have any similar experiences or suggestions on how to track this problem down to its source?

EDIT: This code does not add a menu item in an empty menu called "Stuff":

function material_menu_menu (){
  $items['stuff/existing'] = array(
    'title' => '020000 Existing', 
    'page callback' => 'material_view' , 
    'page arguments' => array ('sum' , '020000 '), 
    'type' => MENU_NORMAL_ITEM, 
    'menu_name' => 'Stuff',   
    'access callback' => TRUE,
    'weight' => '2 ');
}

While working on the layout of a new custom menu, I discovered that the hook_menu process is not working on my D7.12 local site. As a test I enabled the Menu_example module and found that it will not generate menu items in the navigation menu, although it did a week or two ago. So far I have reinstalled all Drupal 7.12 files and confirmed that the module file hook_menus are being read (using dsm). I am at a loss as to what else can be preventing the menu links from being installed.

Does anyone have any similar experiences or suggestions on how to track this problem down to its source?

EDIT: This code does not add a menu item in an empty menu called "Stuff":

function material_menu_menu (){
  $items['stuff/existing'] = array(
    'title' => '020000 Existing', 
    'page callback' => 'material_view' , 
    'page arguments' => array ('sum' , '020000 '), 
    'type' => MENU_NORMAL_ITEM, 
    'menu_name' => 'Stuff',   
    'access callback' => TRUE,
    'weight' => '2 ');
  return $items;
}
added code
Source Link
Ashlar
  • 5.1k
  • 6
  • 35
  • 56
Loading
Source Link
Ashlar
  • 5.1k
  • 6
  • 35
  • 56
Loading