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. 関連モジュール タイトル昇順で並び替える
サイトの構築 8.3x Webform Webformモジュール メールアドレスの入力ミス確認
フォーム 7.15 Webform Template Webformを複写したい
フォーム 7.15 Webform WebformのEntity Translation
フォーム 8.7.x Webform WebformのCheckboxの要素にて表記の変更
フォーム 7.15 Webform Webformで確認画面
コンテンツの作成 7.38 Webform Webformでテーブル形式にしたい
フォーム 7.38 Webform Webformでタクソノミーを参照したい
Japanese mail 7.15 Webform, Mail System, Mime Mail, Japanese Mail Helper Webformから文字化けしないメール送信を行うには
フォーム 7.15 Webform Webform - 確認ページの多言語化
css 7.38 Webform Webfomの送信内容確認ページで表示が崩れる
言語 7.28 vim vimで全角が化けてしまう
フォーム 7.38 Views Views一覧の絞り込み検索フォームで複数フィールドを対象にしたい
排他 7.26 lock Viewsモジュールの設定ページのような排他機能
Views 8.4x hook_views_query_alter Viewsクエリの条件式にサブクエリを追加する方法
Views 8.4x hook_views_query_alter Viewsクエリに多くの条件を追加する方法
サイトの構築 7.22 Views Devel Viewsの設定ページが変に?
ダウンロード 6.x Views Bonus Pack Viewsで表示した内容をCSVダウンロード
コンテンツの作成 7.26 CKEditor Views Viewsでティザーを一覧するとページのレイアウトが崩れることがある
Views Exposed Filter 8.4x hook_views_pre_view Views Exposed Formの複数単語入力(textfield)をフォーム上だけ複数行入力(textarea)にする方法
フォーム 8.9.x Views Views exposed filterのフォームに#default_valueを仕込む方法

ページ