Twig for Designers
These slides explain the Twig templating language, used by Craft CMS, for designers and developers. Brandon Kelly
These slides explain the Twig templating language, used by Craft CMS, for designers and developers. Brandon Kelly
Dieses Tutorial dreht sich um die Twig Basics - Essentiell für alle die Templates für Craft programmieren. Sascha Fuchs
Craft CMS gives you an exceptional amount of control to balance design freedom, a flexible content architecture, and powerful management features for content strategists. In this workshop we will explore Craft's wide range of tools to help manage your content strategy. Read More »
Ben Parizek
Example Twig code for all default Craft CMS field types. Read More »
Slides from "Programming in Twig", presented at the 2015 Craft CMS Summit from Environments for Humans. Marion Newlevant
Even though Twig is just (just) a templating engine for PHP applications (like the super smooth Craft CMS), it can also do lots of “programmy” things on its own, too. Ryan Irelan
Macros are the Twig version of functions. Just like you would write a function in PHP to do something and return something, you can use a Twig macro to generate some output. Ryan Irelan
Twig doesn’t refer to a key, value array as an array. It calls it a hash. Mijingo
Templating in Craft using Twig can, at first, be a little confusing. If you, like me, come from other systems that have a proprietary template tag system, then it might take a little time to wrap your head around how Craft and Twig work. Ryan Irelan
Developer Marion Newlevant and top Craft CMS StackExchange contributor stops by the show to explain the Twig templating language that powers Craft CMS. We compare Twig to other templating and programming languages, discuss DRY approaches to Craft and dive into macros, includes, extends, and embeds! We share learning resources as well as common Twig mistakes and what could be better explored in documentation. CTRL+CLICK CAST
Craft provides several powerful options for you to retrieve content in templates and in plugins. Let's take a look how to query our Entries and other Elements in Twig and in PHP. Read More »
Ben Parizek
Using Twig to manipulate Craft's ElementCriteriaModel objects makes for leaner and meaner templates. Relatively complex functionalities can also be built pretty easily. Jérôme Coupé
Sometimes the order of things matters. This article begins to explore how Twig Templates in Craft CMS are processed. We'll take a look at the order in which the `set`, `block`, `extends` and `include` tags get evaluated and rendered. Understanding the logic behind how the page is processed will help you decide when to use these tags; whether you should be using these tags in your layouts, page templates, or partials; and know when you need to consider alternative methods to pass variables between your templates more easily when dealing with more advanced templating needs. Read More »
Ben Parizek
The spreadsheet "Example Twig code for all default Craft fields" outlines simplified output code for all of Craft's default field types and how they fit into three different tasks we run into again and again in our Twig templates. Read More »
Ben Parizek
Use the power of Craft and Twig to create a context-focused templating system that is as flexible, powerful, and manageable as you need. Anthony Colangelo