Twig開発用の設定

カテゴリ テーマ コアバージョン 8.3x 関連モジュール Core

テーマシステム(Twig)を開発するための設定方法

コメント

ユーザー actbrain の写真

■ settings.local.phpを作成する
$ cd /path/to/document-root/sites/default
$ cp ../example.settings.local.php settings.local.php

■ settings.local.php から development.service.yml を読み込むようにする
$ cd /path/to/document-root/sites/default
$ vim settings.local.php
$ diff -upN ../example.settings.local.php settings.local.php

-# $settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';
+$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/development.services.yml';

-# $settings['cache']['bins']['render'] = 'cache.backend.null';
+$settings['cache']['bins']['render'] = 'cache.backend.null';

-# $settings['cache']['bins']['discovery_migration'] = 'cache.backend.memory';
+$settings['cache']['bins']['discovery_migration'] = 'cache.backend.memory';

+$settings['file_private_path'] = '/path/to/private'; // ついでにプライベートディレクトリを定義する

■ development.service.yml にデバッグ用設定を追加する
$ cd /path/to/document-root/sites/default
$ vim ../development.services.yml
〜以下の行を追加する
parameters:
http.response.debug_cacheability_headers: true
twig.config:
debug: true
auto_reload: true
cache: false

■ settings.php から settings.local.php を読み込むようにする
$ cd /path/to/document-root/sites/default
$ vim setting.php
$ diff -upN default.settings.php settings.php

-# if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
-# include $app_root . '/' . $site_path . '/settings.local.php';
-# }
+if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
+ include $app_root . '/' . $site_path . '/settings.local.php';
+}

■ Cacheをクリアする
$ drush cr

ページ

OTHER FAQ

Drupal開発・運用の疑問/質問の答えはここに

無料ユーザー登録すると質問できます。

カテゴリ Core Ver.昇順で並び替える 関連モジュール タイトル
Japanese mail 7.15 Webform, Mail System, Mime Mail, Japanese Mail Helper Webformから文字化けしないメール送信を行うには
フォーム 7.15 DefaultTextForNode 新しいページの作成方法を一から教えてください
コンテンツの作成 7.15 Form API Validation フォームの入力内容を細かくチェックしたい
言語 7.15 Entity Translation デフォルトの言語 - Entity Translation
タクソノミー 7.15 Taxonomy manager タクソノミーを効率よく管理したい
見栄え 7.15 js Injector 簡単にJavascriptを追加する方法は?
テーマ 7.15 CSS Injector 簡単にCSSを追加したい
ユーザの管理 7.15 Devel 簡単に指定ユーザにログインしなおす方法
アップデート 7.15 Webform Backup_and_Migrate drupal7.12 -> drupal7.14アップデートメモ
コンテンツの管理 7.15 Content Access 簡単に閲覧制限を行うには?
権限 7.15 Path_Access Content_Access 特定のページ(パス)をアクセス制限したい
コンテンツの作成 7.15 Automatic_Nodetitles Automatic_Entity_Label ノード投稿フォームにタイトル入力フォームを表示しない方法
フォーム 7.15 Webform Template Webformを複写したい
言語 7.15 Entity Translation 各フィールドのラベルの多言語切り替え漏れ(フィールド・ラベル)
コンテンツの作成 7.15 Mailhandler メールを通じてnodeの投稿をするには
言語 7.15 Entity Translation nodeのEntity Translation
タクソノミー 7.15 Hirarchical Select タクソノミー(ターム)の選択を楽にできないでしょうか
サイトの環境設定 7.15 Secure Pages Secure Pagesが急に機能しなくなった
言語 7.15 Language まだ翻訳されていない英語文、どうにかならない?
言語 7.14 Entity Translation 各フィールドのラベルの多言語切り替え漏れ(接頭子、接尾子)

ページ