2017 © Pedro Peláez
 

drupal-module newcity_twig

Useful Drupal 8 Twig extensions

image

ahebrank/newcity_twig

Useful Drupal 8 Twig extensions

  • Friday, November 17, 2017
  • by ahebrank
  • Repository
  • 1 Watchers
  • 0 Stars
  • 995 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 64 % Grown

The README.md

NewCity Twig Extensions

A Drupal 8 module to provide some useful Twig extensions and functions, (*1)

Currently includes:, (*2)

Extensions

Render helpers

  • resize(style): resize an image with an image style; returns image render array
  • flattenfield: traverse and flatten a render array
  • smarttrim(wordCount): a smarter truncation function (Example: content.field_text|render|striptags|smarttrim(n))
  • alias: get path alias for an entity

Project-specific but potentially useful

  • multilinesuperhead: Break a multiline heading by wrapping all words except the last in <small>

Debug helpers

  • nocomment : removes HTML comments from markup
  • firstlevel : debug dump only the top level of a render array

Functions

  • uniqid() : generate a unique ID with PHP's uniqid()

The Versions

17/11 2017

dev-master

9999999-dev

Useful Drupal 8 Twig extensions

  Sources   Download

17/05 2017

dev-testing

dev-testing

Useful Drupal 8 Twig extensions

  Sources   Download