サイトの環境設定 |
7.23 |
Pathauto |
自動生成されるURLエイリアスがおかしい |
サイトの構築 |
7.31 |
Views |
ブロックViewsの絞り込みが表示されない |
サイトの構築 |
7.23 |
Conditional fields |
ノード編集フォームを動的にしたい |
サイトの構築 |
7.27 |
Context block |
ページ別、カテゴリ別等でブロックの表示有無を簡単にするには |
サイトの構築 |
7.38 |
deployment |
冗長構成におけるアップロードおよび時間指定公開について |
サイトの構築 |
7.22 |
Views Devel |
Viewsの設定ページが変に? |
サイトの構築 |
7.59 |
Drupal.ajax |
drupal 7 で Uncaught TypeError: Drupal.ajax is undefined となったときの対応方法 |
サイトの構築 |
7.26 |
Field Views |
フォーム選択肢(プルダウンやチェックボックス、ラジオボタン)のカスタマイズ方法 |
サイトの構築 |
7.38 |
Content Template |
ページテンプレートが反映されません。 |
サイトの構築 |
7.22 |
Views |
フィールドセットの伸縮をノンプログラミングでやりたい |
サイトの構築 |
8.3x |
Webform |
Webformモジュール メールアドレスの入力ミス確認 |
サイトの構築 |
7.50 |
Module Missing Message Fixer |
モジュールをアンインストールしたらエラーがでるようになった |
サイトの構築 |
7.41 |
Rules |
Paygent モジュールについて |
サイトの構築 |
7.34 |
ECK |
Entityの使い方について |
サイトの構築 |
8.9.x |
Webform |
drupalを使用した登録、一覧表示の方法について |
サイトの構築 |
7.19 |
Plesk |
Pleskでdrupal7(プライベートファイルシステム)を使う場合の注意点 |
コンテンツの管理 |
8.6.x |
Commerce |
Commerce orderからすべての商品名を取得する方法 |
コンテンツの管理 |
6.x |
Views Flag Calendar |
空き室予約のような仕組みは実現できますか? |
コンテンツの管理 |
8.9.x |
|
写真の変更を行いたい |
コンテンツの管理 |
8.9.x |
Dialog Modal Canvas |
drupal 8 の標準機能のダイアログ/ポップアップを表示する方法 |
コメント
hook_preprocess_page() と hook
パーマリンク Submitted by actbrain on 2015/07/01 16:00.
hook_preprocess_page() と hook_preprocess_node() を使うことで可能になります。
/**
* Implement hook_preproces_page().
*/
function モジュール名_preprocess_page(&$variables) {
if (ノード編集タブをネジアイコンにしたい) {
if (user_access('access contextual links')) {
if (arg(0) == 'node' && is_numeric(arg(1)) && !arg(2)) {
$variables['tabs'] = array('#secondary' => array()); // 標準の編集タブを削除
}
}
}
}
/**
* Imprement hook_preprocess_node().
*/
function モジュール名_preprocess_node(&$variables) {
if (ノード編集タブをネジアイコンにしたい) {
if (user_access('access contextual links')) {
$menu_local_tasks = menu_local_tasks();
if (isset($menu_local_tasks['tabs']['output'])) {
$variables['content']['#prefix'] = '<div class="contextual-links-region">'.
'<div class="contextual-links-wrapper">'.
'<ul class="contextual-links">'.
render($menu_local_tasks['tabs']['output']).
'</ul>'.
'</div>';
$variables['content']['#suffix'] = '</div>';
}
}
}
}
ページ