Twig Templates in Craft

In this course you will get a comprehensive overview of working with Twig templates in Craft. The goal is to get over the hump of writing Twig code, dispel any myth that using Twig is difficult, and help you take the next step in using Craft.

Start Course
Ryan Irelan

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.

Twig Templates in Craft is made up of the following videos:

1Course IntroductionWe learn what the course is about and the topics covered. 05:51
2Basics of Templates in CraftLearn how Craft stores templates, how template routing works, and get an introduction to the Twig syntax. 09:09
3Basics of Twig SyntaxWe go over the basics of how the Twig syntax works and compare it to PHP. 16:24
4What We're BuildingLet's quickly review the sample project we'll be working on in this course. 01:25
5How Craft and Twig Work TogetherWhere does Twig end and Craft begin? 11:47
6Writing Twig Code in CraftLet's jump in and work with some code to put into practice the theory we've already learned about Craft and Twig template code. 18:39
7Template Inheritance in CraftWe can create on or more base layout templates and inherit them in other templates using the the extends feature in Twig. 09:55
8Template Sharing with Includes and EmbedsSharing templates is easy in Craft with the include and embed tags. They will help you build reusable, modular templates. 07:57
9Using Filters in Twig and CraftFilters in Twig and Craft allow you to alter data stored in a variable or as you output it. There are dozens of filters available in both Twig and Craft. 04:49
10Creating a Macro in TwigMacros are the Twig version of functions. Just like you would write a function in PHP to do or create something, you can use a Twig macro to generate some output. 08:08
11Congrats, you did it!You made it all the way through the course. Let's reflect on your success and what you've learned! 00:54