Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Drupal 8 is upon us and with it comes the Twigification of all theme output. Anything that was a PHP template or theme function in Drupal 7 is now a Twig template so we all need to level up on our Twiggy knowledge—and I'm not talking about this Twiggy or this Twiggy.

Introduction

TODO

Syntax

TODO A few examples to grok it

...

Syntax

Printing 

Code Block
{{ someVar }}


Comments

Code Block
{# This is a comment, yo. #} 


Control Structures

Code Block
{% if var %} 
... 
{% endif %}


Code Block
{% for user in users if user.active %} 
	{{ user.name }} : {{ user.email }} 
{% else %} 
	{# No active users #}
{% endfor %}


Documentation

From the creators: 


Drupal specific:

Tutorials:


Dev Setup