More Related Content
Similar to DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
Similar to DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels) (20)
More from Drupaltour (19)
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
- 14. Add CSS and JS
THEME.libraries.yml
global-styling:
version: 1.x
css:
theme:
global-styling/css/style.css: { media: all }
js:
global-styling/js/scripts.js: {}
- 16. Other Ways to include assets
● hook_library_info_alter()
● hook_preprocess_page()
● hook_page_attachments_alter()
- 18. Why Twig
● Secure
● Separate business logic from display
● Faster, smarter templating engine
- 20. Twig Templates
● 141 Twig templates*
● To override, place in *.html.twig in theme
folder
● Don’t forget to drush cr
- 21. Twig Code Basics
● To print {{ my_variable }}
● To comment {# comment #}
● To operate {% if title %}
- 27. Other things
● Drupal settings for use in js
● Classy module
● Initialize Image Style Settings in theme
● No HOOK_process