1

I have a page with multiple tabs rendered via hook_menu and MENU_LOCAL_TASK. Whenever I click a tab the title of the page in the content area changes to 'Home'. How can I set this to stay at 'My Settings'?

Here's my code:

 $items['settings'] = array(
'title' => 'My Settings',
'page callback' => 'drupal_get_form',
'page arguments' => array('settings_page_form'),
'access arguments' => array('access content'),
'file' => 'settings.inc',
'file path' => drupal_get_path('module','mymodule') . '/includes',
'type' => MENU_CALLBACK,
'access callback' => TRUE, );

 $items['settings/account'] = array(
'title' => 'Account Settings',
'title_callback' => $items['settings']['title'],     
'type' => MENU_DEFAULT_LOCAL_TASK,
 'weight' => -3,   );


 $items['settings/layout'] = array(
'title' => 'Page Layout',
'title_callback' => $items['settings']['title'],
'page callback' => 'drupal_get_form',
'page arguments' => array('settings_layout_form'),
'access arguments' => array('access content'),
'file' => 'settings.inc',
'file path' => drupal_get_path('module','mymodule') . '/includes',
'type' => MENU_LOCAL_TASK,
 'weight' => -2,   ); 

 $items['settings/shopping'] = array(
'title' => 'Shopping Preferences',
'title_callback' => $item['settings']['title'],
'page callback' => 'drupal_get_form',
'page arguments' => array('settings_shopping_form'),
'access arguments' => array('access content'),
'file' => 'settings.inc',
'file path' => drupal_get_path('module','mymodule') . '/includes',
'type' => MENU_LOCAL_TASK,
 'weight' => -1,

);

Ken J
  • 4,312
  • 12
  • 50
  • 86

1 Answers1

0

I just used drupal_set_title to set the Page title of the page. It seems that this is done by design to allow tabs to set their own titles.

http://drupal.org/node/1699560

Ken J
  • 4,312
  • 12
  • 50
  • 86