In this course, we’re going to build a Twig filter and a Twig function that will make it easy to "plantify" any text we pass in. Along the way we'll learn the fundamentals of extending Twig inside of Craft CMS.
I am the creator of CraftQuest, a web developer, and former software team manager. I spend most of my time improving CraftQuest with code and courses. When I'm not in front of the computer, I spend my time with my family, and running on the roads and trails of Austin, TX.
Extending Twig in Craft CMS is made up of the following videos:
|1||The Twig Filter and Functions We'll Build||A brief review of what we'll create in this course.||02:24|
|2||Setting Up a Craft Module to Extend Twig||The setup work in a Craft module to support a Twig extension.||05:26|
|3||Extending Twig with a Filter||We code a filter that manipulates a string of text passed in via and returns it to the Twig template.||07:43|
|4||Extending Twig with a Function||Now we set our sights on creating a Twig function. This is quick and easy because all of the supporting code is already there.||05:56|
|5||Creating Another Twig Function||We create another Twig function but this time we pass in an array of words to use as replacements.||04:28|
|6||Creating a Twig Global Variable||Learn how to add a Twig global variable to your Craft plugin or module via a Twig Extension.||19:29|
Andrew demonstrates how he uses an extended template to set global variables right in Twig. No PHP required!
Ryan and Andrew answer questions about where to start with front-end tooling, what makes a good Craft CMS hosting provider, and how to create a Twig global variable in Twig.
Andrew and Ryan answer your questions and show how the embed tag in Twig works.
How to create custom Twig filters and functions in Craft CMS.
Follow along with Sprig developer Ben Croker and build a multi-step reactive form with Craft CMS and Sprig.
Create reusable templates that can render content from any section of a site.
In this course we’re going to build a component library using Fractal for the Crafty Coffee website using Fractal.