テーマシステム(Twig)を開発するための設定方法
Twig開発用の設定
OTHER FAQ
カテゴリ | Core Ver. | 関連モジュール | タイトル |
---|---|---|---|
テーマ | 8.3x | Theme | drupal8 で パスに応じたページテンプレート名を利用する方法 |
テーマ | 8.3x | Core | Twig開発用の設定 |
テーマ | 7.56 | field | レンダリング配列内に「ラベル非表示」を指定する方法 |
テーマ | 7.15 | CSS Injector | 簡単にCSSを追加したい |
テーマ | 8.3x | Block Cache Theme | 管理ページから作成したカスタムブロックを非キャッシュ化する方法 |
チューニング | 7.26 | PHP | DrupalはNginxで動く? |
ダウンロード | 6.x | Views Bonus Pack | Viewsで表示した内容をCSVダウンロード |
タクソノミー | 7.15 | Taxonomy manager | タームを他のボキャブラリ配下に移動したい |
タクソノミー | 7.15 | Entity_Trarnslation Taxonomy | TaxonomyのEntity Translation |
タクソノミー | 7.15 | Taxonomy manager | タクソノミーを効率よく管理したい |
タクソノミー | 7.15 | Hirarchical Select | タクソノミー(ターム)の選択を楽にできないでしょうか |
サイト情報 | 8.9.x | api | Drupal::request() メモ |
サイト情報 | 8.4x | JavaScript | JavaScriptに変数を渡す方法 |
サイトの環境設定 | 7.15 | トップ(ホーム)ページを変更するには? | |
サイトの環境設定 | 7.23 | Pathauto | 自動生成されるURLエイリアスがおかしい |
サイトの環境設定 | 7.38 | Views Bulk Operation | VBO(Views Bulk Operation)で指定したアクションが表示されない |
サイトの環境設定 | 8.6.x | Simhony Yaml | yamlファイルを読み込む方法 |
サイトの環境設定 | 7.59 | さくらのレンタルサーバー php Options | さくらのレンタルサーバーで パブリック/プライベートディレクトリにファイルが書き込まれないとき |
サイトの環境設定 | 7.23 | Image Style | 画像スタイルの使い方(Crop) |
サイトの環境設定 | 8.9.x | 編集 |
コメント
■ 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
ページ