https://github.com/delcesar/twig_filters
Drupal 8 Module. Provides additional filters for Twig such as TruncateHTML, ...
https://github.com/delcesar/twig_filters
drupal8 drupal8-module twig-filter
Last synced: 4 months ago
JSON representation
Drupal 8 Module. Provides additional filters for Twig such as TruncateHTML, ...
- Host: GitHub
- URL: https://github.com/delcesar/twig_filters
- Owner: delcesar
- Created: 2019-09-19T20:30:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-19T21:08:01.000Z (over 6 years ago)
- Last Synced: 2025-06-01T07:55:06.075Z (12 months ago)
- Topics: drupal8, drupal8-module, twig-filter
- Language: PHP
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Twig_Filters
twig_filters is a module for Drupal 8 which provides custom Twig filters.
## Installation
1. In modules, create a directory named custom and copy twig_filters inside. (DrupalSite/modules/custom/twig_filters)
2. Install the module in Drupal
### TruncateHtml Filter
Truncate a HTML string without breaking tags. Useful for previews or on Teaser
## Usage
```twig
{{ body|truncatehtml(200)|raw }}
```