Talking Twig
summary
Proposes replacing many near-identical field templates with one base field.html.twig that uses null coalescing ternary and extends + blocks to choose wrapper elements and classes, so a child template can set element=h2 and classes="call-out headline" in three lines instead of duplicating HTML; demonstrates reuse for blocks/forms, notes Twig searches templates recursively, is 100% backward-compatible, and recommends the twig_tweak module to simplify raw field output.
AI-written summary · about
chapters (24)
- 0:00Introduction
- 0:33Outline
- 2:22Background
- 2:58Twig Essentials
- 3:20Advanced Features
- 4:33Advanced Functions
- 5:46BAM
- 7:46Template Suggestions
- 9:55Template Anatomy
- 11:39Template Example 1
- 12:30Template Example 2
- 13:18Working with Twig Templates
- 17:42Deep in the weeds
- 18:04Recap
- 19:40CSS Classes
- 20:29Custom HTML Elements
- 21:09In Action
- 21:58Final Template
- 24:29Notes
- 26:15Templates
- 28:57Blocks
- 30:28Resources
- 32:12Questions
- 36:16Functions
related talks
44mWhat the frontend? Get the most out of Twig, render arrays and D8's caching
26mUsing Twig and Views to Create Friendly HTML E-newsletter Code
01h 01mDrupal 8 theme best practices - here's where we burried the bodies
49mLiving Styleguide in your Drupal projects: Benefit from component driven design.
54mTaming Twig
35m"The Step After Styleguides"
48mClientside templates for reactive UI
22mA New Way to Build for the Web
