2

in /var/aegir/platforms/drupal8-dev/sites/my_site_uri/settings.php

  # Additional site configuration settings.
  if (is_readable('/var/aegir/platforms/drupal8-dev/sites/my_site_uri/local.settings.php')) {
    include_once('/var/aegir/platforms/drupal8-dev/sites/my_site_uri/local.settings.php');
  }

in /var/aegir/platforms/drupal8-dev/sites/my_site_uri/local.settings.php

       <?php # local settings.php

$settings['container_yamls'][] =DRUPAL_ROOT . '/sites/default/services.yml';

in /var/aegir/platforms/drupal8-dev/sites/default/services.yml

 parameters: 
   twig.config:
     debug: true
     auto_reload: null
     cache: false

The firebug console comments are working meaning twig debug is activated but dump (twig debug extension ) is not working . why? is there anything more to set in services.yml ?

  {{ dump() }}
3

Turn on Twig debugging by:

Copy sites/example.settings.local.php and rename to sites/default/settings.local.php

Go to sites/default/settings.php and uncomment the code below the comment relating to "Local development override configuration" and save the file.

if (file_exists(__DIR__ . '/settings.local.php')) {
  include __DIR__ . '/settings.local.php';
}

Open sites/development.services.yml in a text editor and add the following to the bottom of the file and then save the file

  parameters:
    twig.config:
      debug: true
      auto_reload: true
      cache: false

Note: use two spaces for each indent. Twig can be fussy with this.

The debugging will be visible as html comments in the source code. Use Chrome or other developer tools to inspect.

If you want to inspect the data structure of variables in a speciifc template, install Devel module and enable Devel and Devel Kint and then add this in your template:

# to dump everything
{{ kint() }}


# to dump a variable
{{ kint(page) }}


# to dump lower down in the data structure
{{ kint(page.content) }}
  • twig debugging is working as i say in my msg. but the dump function is not working twig.sensiolabs.org/doc/functions. As for kint i have activated devel kint module and putting {{ kint() }} gives me a WSOD with nothing in the logs !? – Matoeil Oct 28 '16 at 8:09
  • 1
    Apologies for my detailed answer. I meant for you to check your settings against my answer. I found this post where someone was having and out of memory issue (and suggested solution) because dump or kint was too large. drupal.stackexchange.com/questions/204598/… – user68786 Oct 29 '16 at 6:35
1

try

$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/my_site_uri/services.yml';

or to keep it more generic:

$settings['container_yamls'][] = __DIR__ . '/services.yml';
1

As for kint i have activated devel kint module and putting {{ kint() }} gives me a WSOD with nothing in the logs !??

I had the same problem as mentioned here, the solution is:

According to Devel maintainer willzyx:

you can edit modules/devel/kint/kint/config.default.php and set $_kintSettings['maxLevels'] to a lower number (the default is 7)

So try lowering it to 5 or 4.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.