This module allows you to use Twig code directly within your content fields. When you apply this filter to a text format, any Twig syntax entered in fields using that format will be processed and replaced with the rendered output.
This is a very simple module to make twig values available as an input filter.
Composer Install
If your site is managed via Composer, use Composer to download the module.
composer require 'drupal/filter_twig:^3.0'
Or
Install the module as any other module.
Usage
Visit the text format administration page at:
/admin/config/content/formats
And edit a text format.
Check the 'Replaces Twig values' filter and save the text format.
When editing a form where this text format is used in a field, you can type
twig that will be replaced when the field is rendered.
Ask your assistant about Filter Twig
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
- filter Drupal core
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 3.0.x-dev | Dev | 8–11 | Nov 15, 2024 | ||
| 3.0.0 | Stable | 8–11 | Nov 15, 2024 | ||
| 8.x-2.2 | Stable | 8–10 | Nov 1, 2023 | ||
| 8.x-2.2-rc1 | Pre-release | 8–10 | Oct 31, 2023 | ||
| 8.x-2.x-dev | Dev | 9–10 | Oct 31, 2023 |