Drupal - how to add add one page to two menus?

How can I add the 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;
}

      

+2


a source to share


2 answers


You can create as many menu items with hook_menu

as you like. They can all be assigned to the same callback function as long as the value page callback

has the same name.



0


a source


There are several solutions currently available:

The multiple_node_menu module answers the question without interception. On node you can put the menu item in two places and set the main parent (router).



There is also Node Symlinks , which works differently, allowing the same content to be displayed in two different places on the site without the SEO penalty, (not what I was looking for)

0


a source







All Articles