I am creating a module that allows your users to add channels. So I want my code to provide tabs that can be rewritten at the theme level.
I thought this could be done using hook_menu:
$items['tab_add_feed'] = array(
'title' => 'Add Feed',
'page callback' => 'xml_parser_add_feed',
'access callback' => 'user_access',
'access arguments' => array('manage own feeds'),
'type' => MENU_LOCAL_TASK,
);
something like above. But I use it on the front of the site.
How to add tabs or links at the top of my page in drupal?
//edit
There are no tabs at the moment, maybe I need to make them visible?
fixed it by adding <a href="xml_parser/add_feed">add feed</a>to the callback function of the main page But this is ugly, hard-coded, not thematic. waiting for a better solution.
//edit
This is the code I'm using now
function xml_parser_menu() {
$items = array();
$items['xml_parser'] = array(
'path' => 'xml_parser',
'title' => t('Feed'),
'description' => t('Add/edit feeds'),
'page callback' => 'xml_parser_manage_overview',
'access callback' => 'user_access',
'access arguments' => array('manage own feeds'),
'type' => MENU_NORMAL_ITEM,
'menu_name' => 'primary-links',
);
$items['xml_parser/add_feed'] = array(
'path' => 'xml_parser/add_feed',
'title' => 'Add Feed',
'page callback' => 'xml_parser_add_feed',
'access callback' => 'user_access',
'access arguments' => array('manage own feeds'),
'type' => MENU_LOCAL_TASK,
);
return $items;
}