Next Level Twig: Extensions
summary
Shows how to add real Twig extensions to Drupal 8: uses Twig Tweak and the twig_extensions library, then walks through building a custom module that registers a service tagged twig.extension and exposes countdown filter and function implementations that call Drupal’s date formatter. Demonstrates adding the filter to a theme template, clearing caches, and the output working; advises wrapping existing services rather than embedding DB queries or heavy logic in templates.
AI-written summary · about
chapters (21)
- 0:00Intro
- 0:21About Us
- 0:47Twig Limitations
- 2:30Twig Extensions
- 2:40Tags
- 3:07Filters Functions
- 3:33Core Filters
- 3:57Drupal Functions
- 4:07TwigTweak
- 5:53Twig Extensions Module
- 6:30Custom Extensions
- 6:58Defining a Service
- 7:11Creating a Service
- 7:21Filters and Functions
- 7:49The Good Parts
- 9:13Adding the Tags
- 18:37Keys to Success
- 18:56Pass Throughs
- 19:51Golden Rule
- 20:36Resources
- 21:10Questions
