我有一个页面,其中包含通过 hook_menu 和 MENU_LOCAL_TASK 呈现的多个选项卡。每当我单击选项卡时,内容区域中的页面标题都会更改为“主页”。如何将其设置为留在“我的设置”?
这是我的代码:
$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,
);