Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By parijke on
To abstract some vars I would like to read a yaml file to get some vars into my twig files.
Is this possible?
Thank you
Comments
You can from preprocess and
You can from preprocess and set it into variables for the template.
If they're config yml you can get it directly from configuration, but if they're not you have to parse the yml file and get key/values from that, e.g. something along the lines of:
Config is well covered in the docs, e.g. https://www.drupal.org/developing/api/8/configuration/simple
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.