Including markup into a separate reusable twig template

Опубликовано: 30 Сентябрь 2024
на канале: Drupal Up - Drupal 8 Video Tutorials
1,589
33

In this video, we are going to implement a partial twig template with a custom variable and we are going to reuse it in two sections in our Drupal 8 theme.


If you want to learn more about Drupal 8 theming - please check our "Full course on Drupal 8 theming here" with this link you get 30% discount - https://goo.gl/yEyiLc

- Download Animate CSS
- Create a library with Animate CSS
- Create our Partial template (with including the css library there)
- Use it in two different occasions
- {% include directory ~ '/templates/fancy_title.html.twig' with { title: node.getTitle() } %}
- {% include directory ~ '/templates/fancy_title.html.twig' with { title: ‘Wonderful Title’ } %}