Provides the Twig template engine as an input filter. Twig templates are stored as CTools Exportables, so you can edit them from the UI, and export them as Features Components.
Dependencies
- CTools
- Libraries API
- Twig (place it in
sites/all/libraries/twig
orsites/<domain>/libraries/twig
Usage
- Go to
admin/structure/twig/add
and create a template or two - Go to
admin/config/content/formats
and activate Twig on an input filter - Create a node using the Twig input filter. Use the Twig syntax
{% include 'template_name' %}
to include a template.
Future Development
I'm interested in extending this module to integrate Drupal and Twig in other ways. Feel free to post feature request issues with your thoughts and/or code. In particular, I'd like to add support for Tokens as Twig variables, and set up the Twig sandbox to restrict privileges for users having access to Twig-enabled input formats.
Related
Project information
- Module categories: Content Editing Experience, Integrations
- 875 sites report using this module
- Created by smokris on , updated
- Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
Development version: 2.0.x-dev updated 29 Jan 2023 at 08:06 UTC
Development version: 7.x-1.x-dev updated 6 Jul 2016 at 20:22 UTC