Session
21 things I learned using Twig & Drupal 8
Theming in Drupal 8 was a massive shift from phptemplate to Twig — but it was more than changing the syntax. It changed the way of thinking about Drupal theming. Drupal Twig theming is easy to learn, powerful, flexible, and overall as satisfying as warm coffee on a rainy day. The downside is that all the things you learned in Drupal now had to be relearned — yes, by design.
Over the preceding years, the front-end Drupal Twig community had gathered hands-on experience with the new templating engine. This session distilled that collective knowledge into 21 practical takeaways, covering template building, concept changes, and common pitfalls to avoid when moving from phptemplate to Twig in Drupal 8.
About the Speaker
Morten Birch presented this session as part of Drupal 8 Day, sharing insights drawn from real-world experience with Twig in Drupal 8 projects. The talk focused on hands-on learning and helping developers navigate the transition from phptemplate to Twig with confidence.
Drupal 8 Day was organized by OSTraining and made possible by the Drupal community.
The transition to Twig in Drupal 8 represented far more than a simple syntax change for themers. It signaled a fundamental shift in how developers approach Drupal theming altogether, moving from the older phptemplate approach to a cleaner, more intuitive template system built on the familiar Twig language. For those who had invested years mastering Drupal theming conventions, this meant relearning nearly everything — from how variables are exposed to templates to how template suggestions are handled. Yet the effort proved worthwhile, as Twig brought a new level of clarity, flexibility, and power to the theming layer. Session attendees walked away with practical insights gathered from real-world experience, discovering that while the learning curve was real, the rewards of embracing Twig were substantial and lasting.
Related
Explore More Sessions
This session was one of several presentations at Drupal 8 Day. Also check out Component-driven Drupal theming by Mario Hernandez, which covered modern front-end workflows with Styleguide, KSS, Node, Twig, NPM, Gulp, BEM, and libSass.
Video recordings from the event are available on YouTube.