I have a module with a bunch of menu-items. Is it somehow possible to show the MENU_LOCAL_TASK's when a MENU_CALLBACK is called? The structure basically is like this:
- A normal menuitem in the user-menu
- Some local tasks
- 'test/%user_uid_optional/test2' in this example would be an overview-Page with several links as defined in in the last item.
This all works great, except I want the local tasks to be visible when the user clicks on 'test/%user_uid_optional/test2/%test'. Since I don't have breadcrumbs that's the only easy way for the user to get back to the overview page. Any idea?
function test_menu(){
$items = array();
$items['test/%user_uid_optional'] = array(
'title' => 'test',
'page callback' => 'test_whatever',
'page arguments' => array(1),
'access callback' => 'user_view_access',
'access arguments' => array(1),
'type' => MENU_NORMAL_ITEM,
'menu_name' => 'user-menu',
);
$items['test/%user_uid_optional/test1'] = array(
'title' => '...',
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -20,
);
$items['test/%user_uid_optional/test2'] = array(
'title' => 'test2',
'page callback' => 'test_whatever_b',
'page arguments' => array(1),
'access callback' => 'user_view_access',
'access arguments' => array(1),
'type' => MENU_LOCAL_TASK,
'weight' => -15,
);
$items['test/%user_uid_optional/test2/%test'] = array(
'title' => '...',
'page callback' => 'drupal_get_form',
'page arguments' => array('test_whatever_d', 1, 3),
'access callback' => 'user_view_access',
'access arguments' => array(1),
'type' => MENU_CALLBACK,
);
return $items;
}