Twig is a new PHP-based, compiled, templating language that is slated to be the default theming engine in Drupal 8 (which will ship with only one theme engine.) It brings about significant improvements that promise to make front-end development simpler, faster and more secure.
One of the main benefits of Twig is to hand the power to create really awesome designs back to the designers, and to unfetter them from development cycles and constraints. In this session we’ll take an in-depth look at what specific changes it brings and how to use Twig in Drupal 8– as well as how to get started using Twig in Drupal 7.
Some of the topics we’ll cover:
- What’s happening to theme functions?
- How are render arrays and drupal_render() changing?
- How does Twig work with the new “Scotch” Blocks & Layouts Everywhere page assembly?
- How are Twig templates cached and how does this affect performance?
- How to debug a compiled template?
- How do I convert my existing Drupal theme to Twig?
Of course one of the most important questions with Twig –as with any shiny new thing that’s being swapped into an existing stack– is of course “What’s the Upgrade Path?” – In this session we’ll go over how to use a Drupal module to automatically convert your existing Drupal 7 themes to Twig.