テーマシステム(Twig)を開発するための設定方法
Twig開発用の設定
OTHER FAQ
カテゴリ | Core Ver. | 関連モジュール | タイトル |
---|---|---|---|
アップデート | 8.9.x | composer patch | patch を composer に 組み込む方法 |
アップデート | 8.9.x | Composer update | Composer で drupal/core-8.9.7 に更新できなくなった場合の処置 |
コンテンツの作成 | 8.9.x | CSS | キャプション付きの(右寄/左寄)画像を画像サイズを基準にきれいに表示する方法 |
リバースプロキシ | 8.9.x | mod_proxy mod_proxy_http mod_ssl | Apache2.4 から httpsサーバーへリバースプロキシする方法 |
アップデート | 8.9.x | PHP | CentosでPHPのバージョンアップ(例:5.3->5.6)を行う方法 |
テーマ | 8.9.x | Twig | Twig で 月末日を算出する方法 |
Migrate | 9.x | drush config | Upgrade source(環境) を 変更したときにやるべきこと |
コメント
■ settings.local.phpを作成する
パーマリンク Submitted by actbrain on 2017/10/20 01:52.
■ 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
ページ