Video Course

Twig Templates in Craft

by Ryan Irelan

The how, what, and why of using Twig in Craft templates. A companion to the Up and Running with Craft course. Read the full description


Get immediate access to the course.
Secure checkout.

Start Watching for Free

What's in this Course?

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.

What We’ll Cover

  • Review the basics of templates in Craft; how Craft stores templates, and routes requests to templates.
  • Dynamic routes
  • Introduction to Twig and the Twig syntax, including how it compares to PHP.
  • The three different types of Twig tags.
  • Learn how Craft and Twig work together.
  • Coding a sample template in Craft’s Happy Lager sample project.
  • Use the for-loop, special loop variables, conditionals, access Craft data variables, set variables.
  • Sharing templates in Craft using extends, include, and embed tags.
  • Review additional include tags provided by Craft.
  • Use Filters in Craft to manipulate data stored in a variable.
  • Create reusable and customizable markup using macros.
  • Output raw code using the verbatim tag.
  • Set up Craft navigation using the nav tag.
  • Set up Craft pagination use the paginate tag.

Craft Courses Bundle

Both the Craft CMS courses are also available together in a handy bundle. This course + Learning Craft in one simple purchase.

Get the Bundle


What is the difficulty level?


This is a beginner course that teaches the basics of using Twig in Craft. If you took the Learning Craft course, this course will help you get even better at building sites with Craft.

How long is the course?

The course is about 2 hours long and broken up into 3 different modules and more than 10 videos.

Is there a written version of the course, too?

You can download the course workbook, which has similar content as what is covered in the videos. The videos, however, should be the primary learning source.

What if I have a suggestion?

We love feedback about our training materials. Please get in touch and let us know what you think.

Get in touch