An open API service indexing awesome lists of open source software.

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, ...

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 }}
```