10. themename.theme file
● Replaces the template.php file.
● Theme functions go here.
@Mediacurrent
11. What is Twig?
Twig is a template framework that has replaced
PHPTemplate in Drupal 8.
It bills itself as fast, secure and flexible.
And it’s very well documented.
http://twig.sensiolabs.org/documentation
@Mediacurrent
12. Intro to Twig
There are three delimeters you need to know.
● Print variables: {{ … }}
● Comments: {# … #}
● Execute statements: {% … %}
@Mediacurrent
13. Intro to Twig
● Variables can be accessed directly in Twig.
● Classes can be drilled into to show attributes:
<div {{ attributes }}>
{{ content }}
</div>
● Conditional statements: {% if … %}{% endif %}
● Loops: {% for … %}{% endfor %}
@Mediacurrent
17. Where are the twig files?
In the system templates folder
(/core/modules/system/templates) you’ll find more than 40
templates that are available to override—
things like fields, nodes, pages, links.
@Mediacurrent