项目作者: delcesar

项目描述 :
Drupal 8 Module. Provides additional filters for Twig such as TruncateHTML, ...
高级语言: PHP
项目地址: git://github.com/delcesar/twig_filters.git
创建时间: 2019-09-19T20:30:11Z
项目社区:https://github.com/delcesar/twig_filters

开源协议:

下载


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

  1. {{ body|truncatehtml(200)|raw }}