composer require pattern-lab/drupal-twig-extensions
- Ensure your Twig Pattern Engine is v2.2.0 +
- Install this via composer
- Add this to
config.yml
:
twigExtensions:
- '\PatternLab\DrupalTwigExtensions\Basic'
This allows Twig templates that are used in both Pattern Lab and Drupal environments to function correctly. Many times this is simply providing the function so the templates can work. In Drupal if {{ my_var | t }}
is seen, then my_var
is then marked as translatable; so all we need to do in Pattern Lab is well, nothing. We just take the variable and let it pass right through.
t
render
placeholder
without
url
path
link