Drupal 在“配置文件”选项卡旁边的选项卡中显示内容类型
我已经创建了一个名为“我的笔记”的drupal内容类型,我想在profile选项卡旁边的选项卡中显示它。我创建了一个名为“主题”的字段,该字段显示在“我的笔记”内容类型中。单击“创建我的笔记内容”并填写详细信息后,我希望该内容显示在选项卡中Drupal 在“配置文件”选项卡旁边的选项卡中显示内容类型,drupal,tabs,drupal-content-types,Drupal,Tabs,Drupal Content Types,我已经创建了一个名为“我的笔记”的drupal内容类型,我想在profile选项卡旁边的选项卡中显示它。我创建了一个名为“主题”的字段,该字段显示在“我的笔记”内容类型中。单击“创建我的笔记内容”并填写详细信息后,我希望该内容显示在选项卡中 请提供分步说明。编写自定义模块,并使用hook\u menu\u alter()更改选项卡或添加新选项卡。下面是我的一个自定义模块中的一些代码 /** * Implementation of hook_menu_alter(). * Remember to
请提供分步说明。编写自定义模块,并使用hook\u menu\u alter()更改选项卡或添加新选项卡。下面是我的一个自定义模块中的一些代码
/**
* Implementation of hook_menu_alter().
* Remember to clear the menu cache after adding/editing this function.
*/
function profile_customizations_menu_alter(&$items) {
// Changing tab names and weights
$items['user/%user_uid_optional']['weight'] = -10;
$items['user/%user_category/edit']['title'] = 'Account settings';
$items['user/%user_category/edit']['weight'] = -9;
$items['user/%user/profile/individual']['title'] = 'Edit profile';
$items['user/%user/profile/individual']['weight'] = -8;
$items['user/%user/profile/ngo']['title'] = 'Edit profile';
$items['user/%user/profile/ngo']['weight'] = -8;
$items['user/%user/delete']['title'] = 'Delete account';
$items['user/%user/delete']['weight'] = 10;
$items['user/%user/profile']['title'] = 'Profile';
$items['user/%user/profile']['weight'] = -9;
/* $items[] = array( // Change the My account link to display My Profile and drop to bottom of list
'path' => 'use/' . $user->uid,
'title' => t('My Profile'),
'callback' => 'user_view',
'callback arguments' => array(arg(1)),
'access' => TRUE,
// 'type' => MENU_DYNAMIC_ITEM,
'type' => MENU_NORMAL_ITEM,
'weight' => 9
);*/
// $items['user/%user/profile/individual']['title'] = 'My Profile';
/* $items[] = array(
'path' => 'user/' . $user->uid . '/profile',
'title' => t('Profile'),
'callback' => 'user_view',*/
}
用于创建配置文件视图,添加页面类型显示,并在该页面显示中添加该页面的菜单选项卡。这是编写任何代码的另一种选择,加上视图,您可以更轻松地为页面设置主题。使用内容配置文件模块。然后,您将看到将该内容类型添加为配置文件选项卡旁边的选项卡的选项。但我认为,它也将在注册期间可见。我不确定。您是使用CCK还是自定义模块创建“我的笔记”内容类型的?您使用的是Drupal6还是Drupal7?你好,Matt,我使用CCK在Drupal6中创建“我的笔记”内容类型。