Drupal 是一套開放源碼的內容管理平台,擁有多種實用的功能,可以用來建置從個人網誌到大型網路社群等各種類型的網站,例如華納唱片、紐約觀察報、Fast Company、Popular Science、SonyBMG、富比士、哈佛大學等網站,或是個人部落格(Tim Berners-Lee)、播客網站(TWIT.tv)、線上社群(SpreadFireFox.com)。
Drupal 是一套開放源碼的內容管理平台,擁有多種實用的功能,可以用來建置從個人網誌到大型網路社群等各種類型的網站,例如華納唱片、紐約觀察報、Fast Company、Popular Science、SonyBMG、富比士、哈佛大學等網站,或是個人部落格(Tim Berners-Lee)、播客網站(TWIT.tv)、線上社群(SpreadFireFox.com)。
Re: 有無增加「刪除頁籤」的模組?
看來得改 modules/system/system.api.php 跟用到 hook 的東西 :(
- hook_menu_local_tasks_alter | system.api.php | Drupal 7 | Drupal API
Re: 有無增加「刪除」頁籤 (tabs primary) 的模組?
如果是drupal 7 的話,用Views
+Views bulk operations應該可以作得到Re: 有無增加「刪除」頁籤 (tabs primary) 的模組?
hook_menu_alter 比較正路
Re: 有無增加「刪除」頁籤 (tabs primary) 的模組?
我利用 hook_menu_local_tasks_alter(&$data, $router_item, $root_path)

加了一個 primary tab 如下圖
我的環境是 drupal 7.22 不需安裝啟用任何module
下方的程式碼是寫在 ../sites/all/themes/[sky]/template.php
其中 [sky] 是我套用的 theme 名稱,請至您使用的theme資料夾修改 template.php 檔案
如果沒有的話,就自行建立。
註:強烈建議不要直接修改 drupal core 的核心程式,以免一更新就全消失了。
function sky_menu_local_tasks_alter(&$data, $router_item, $root_path) {
if ($data['tabs'] && $router_item['tab_root_href']){
// Add a tab linking to node/add to all pages.
$data['tabs'][0]['output'][] = array(
//'access arguments' = array('access content');
'#theme' => 'menu_local_task',
'#link' => array(
'title' => t('刪除'),
'href' => $router_item['tab_root_href'] . '/delete',
'localized_options' => array(
'attributes' => array(
'title' => t('Delete this content'),
),
),
),
// Define whether this link is active. This can be omitted for implementations that add links to pages outside of the current page context.
'#active' => ($router_item['path'] == $root_path)
);
}
}