pattern-lab / drupal-twig-extensions
Twig Extensions for working with Drupal
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 13 108
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- twig/twig: ^1.0
This package is auto-updated.
Last update: 2023-02-06 09:28:14 UTC
README
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
:
twigExtensions: - '\PatternLab\DrupalTwigExtensions\Basic'
Motivation
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
Filters
t
render
placeholder
without
Functions
url
path
link