Twig Extensions for working with Drupal

v0.2.0 2018-02-07 03:22 UTC

This package is auto-updated.

Last update: 2021-01-06 04:57:07 UTC


composer require pattern-lab/drupal-twig-extensions

How to use

  • Ensure your Twig Pattern Engine is v2.2.0 +
  • Install this via composer
  • Add this to config.yml:
    - '\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.

Twig Functionality Provided


  • t
  • render
  • placeholder
  • without


  • url
  • path
  • link