我已經創建了一個名爲「我的筆記」的drupal內容類型,並且我想將其顯示在配置文件選項卡旁邊的選項卡中。我創建了一個名爲「主題」的字段,顯示在「我的筆記」內容類型中。一旦我點擊「創建我的筆記內容」並填寫詳細信息,我希望這會顯示在選項卡中。在配置文件選項卡旁邊的選項卡中顯示內容類型
請給我一步明智的解釋。
我已經創建了一個名爲「我的筆記」的drupal內容類型,並且我想將其顯示在配置文件選項卡旁邊的選項卡中。我創建了一個名爲「主題」的字段,顯示在「我的筆記」內容類型中。一旦我點擊「創建我的筆記內容」並填寫詳細信息,我希望這會顯示在選項卡中。在配置文件選項卡旁邊的選項卡中顯示內容類型
請給我一步明智的解釋。
編寫自定義模塊並使用hook_menu_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',*/
}
使用Views一個一些代碼來創建配置文件的視圖中添加頁面類型顯示,該網頁顯示中您可以爲網頁添加菜單選項卡。這是編寫任何代碼的替代方案,另外Views還允許您更輕鬆地爲頁面設置主題。
使用內容配置文件模塊。然後,您將看到選擇將該內容類型添加爲配置文件選項卡旁邊的選項卡。但我認爲它在登記時也是可見的。我確信這一點。
您是否使用CCK或自定義模塊創建了「我的筆記」內容類型?你在使用Drupal 6還是Drupal 7? – 2011-01-21 07:59:54