I have menu like this. But menu link is not appear. Where is problem ?

function milkshake_menu($may_cache) {
$items = array();

if (!$may_cache) {
$items[] = array(
'path' => 'milkshake',
'title' => t('Milkshake flavors'),
'callback' => 'milkshake_overview',
'type' => MENU_CALLBACK
);

$items[] = array(
'path' => 'milkshake/list',
'title' => t('List flavors'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'access' => user_access('list flavors'),
'weight' => 0
);

$items[] = array(
'path' => 'milkshake/add',
'title' => t('Add flavor'),
'callback' => 'milkshake_add',
'type' => MENU_LOCAL_TASK,
'access' => user_access('add flavor'),
'weight' => 1
);

$items[] = array(
'path' => 'milkshake/list/fruity',
'title' => t('Fruity flavors'),
'callback' => 'milkshake_list',
'type' => MENU_LOCAL_TASK,
'access' => user_access('list flavors'),
);

$items[] = array(
'path' => 'milkshake/list/candy',
'title' => t('Candy flavors'),
'callback' => 'milkshake_list',
'type' => MENU_LOCAL_TASK,
'access' => user_access('list flavors'),
);
}
return $items;
}

Comments

krishnarp’s picture

First uninstall the module.Then remove " 'type' => MENU_CALLBACK " from the first item
$items[] = array(
'path' => 'milkshake',
'title' => t('Milkshake flavors'),
'callback' => 'milkshake_overview',
);
Then install the same.

Hope this helps you

mysocom’s picture

yes!