tags:

views:

116

answers:

1

How can I add same callback to 2 different menus?

function my_callback_menu(){
  $items = array();
  $items['my_callback'] = array(
    'title'            => t('My title'),    
    'menu_name'        => 'menu-my-menu',   
        'page callback'    => 'my_callback',         
        'access arguments' => array('access content'),            
  );
  return $items;
}
A: 

You can create as many menu items with hook_menu as you want. All of them can be assigned to the same callback function if you make the page callback value the same name.

googletorp
You might want to find a way to wipe the redundant page from the search index. You might check the search_config module.
Grayside
@Grayside I'm not saying you should do this, or even that it's a good idea, only that it's possible. Also the same callback function can provide different output if you use arguments, so it might not even be an issue.
googletorp