O'Reilly logo

Drupal 8 Development Beginner's Guide - Second Edition by Kurt Madel, Malabya Tewari, Rakesh James, Krishna Kanth, Edward Crompton, Samuel Keen, Tassos Koutlas, Neeraj Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – Twig in practice

Ok, let's put some of what you've learned in the previous section into practice. It would be nice to separate out the preparation stage in our recipe from the cooking stage. We'll do this by splitting the two types of fields into separate wrapping div tags, and then apply some styling to help us differentiate them:

  1. We'll find out which template is currently in use by enabling Twig debugging. In PHPStorm, navigate to sites / default. If you have a file named services.yml, open it. If you don't, make a copy of default.services.yml, rename it to services.yml, and open it.
  2. Look for the section called twig.config. In this section, you will find an option that currently says debug: false. Change that value to true and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required