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:

1 Course Introduction We learn what the course is about and the topics covered. 05:51
2 Basics of Templates in Craft Learn how Craft stores templates, how template routing works, and get an introduction to the Twig syntax. 09:09
3 Basics of Twig Syntax We go over the basics of how the Twig syntax works and compare it to PHP. 16:24
4 What We're Building Let's quickly review the sample project we'll be working on in this course. 01:25
5 How Craft and Twig Work Together Where does Twig end and Craft begin? 11:47
6 Writing Twig Code in Craft Let'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
7 Template Inheritance in Craft We can create on or more base layout templates and inherit them in other templates using the the extends feature in Twig. 09:55
8 Template Sharing with Includes and Embeds Sharing templates is easy in Craft with the include and embed tags. They will help you build reusable, modular templates. 07:57
9 Using Filters in Twig and Craft Filters 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
10 Creating a Macro in Twig Macros 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
11 Congrats, 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