How can i add a new tab in node tabs ( with edit, view tabs ) and show a page on this new tab ? i am working on a shopping cart where i need to add a new configuration tabs with nodes and ubercart products.
1 Answer
You need to define a new URL by using hook_menu.
There, 'type' is set as MENU_LOCAL_TASK and URL is like 'node/%node/CUSTOM_CONFIG'.
Code snippet from the hook_menu in node.module:
$items['node/%node/edit'] = array(
'title' => 'Edit',
'page callback' => 'node_page_edit',
'page arguments' => array(1),
'access callback' => 'node_access',
'access arguments' => array('update', 1),
'weight' => 0,
'type' => MENU_LOCAL_TASK,
'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
'file' => 'node.pages.inc',
);