This module provides common additional features for Twig that do not directly belong in core. It used to include these through the twig/extensions package, but since that has been abandoned the extensions have been included in the module itself.
Filters
| Extension name | Description |
|---|---|
shuffle |
Shuffles an array. |
time_diff |
Converts dates to a time ago string like Facebook and Twitter has. |
localizeddate |
Formats dates using \IntlDateFormatter. |
localizednumber |
Formats numbers using \IntlDateFormatter. |
localizedcurrency |
Formats currencies using \IntlDateFormatter. |
truncate |
Truncates text to a certain length, optionally preserving words. |
wordwrap |
Wraps a string into new lines when it reaches a specific length. |
Similar projects
- Twig IntlExtension: provides alternatives to the
localized*filters. Uses the twigphp/intl-extra package, but breaks the coreformat_datefilter - Time diff: provides a
time_difffilter, but isn't as flexible as the original Twig filter
Supporting organizations:
Maintenance
Maintenance
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Developer tools
388 sites report using this module
- Created by joelpittet on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
8.x-2.5
released 11 June 2025
Works with Drupal: ^10 || ^11
Add back missing Twig filters.
Install:
Development version: 8.x-2.x-dev updated 11 Jun 2025 at 11:12 UTC




