twig-drupal-filters
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/twig-drupal-filters package

3.2.0 • Public • Published

Twig.js Drupal Extensions

Greenkeeper badge Build Status

Twig.js implementations of Drupal's Twig functions and filters. Most of these are just stubbed creations from John Albin's work in KSS-Node.

Usage

var Twig = require('twig')
var twigDrupal = require('twig-drupal-filters')

// Add the filters to Drupal.
twigDrupal(Twig);
{{ 'Hello World!'|clean_id }}

Filters

A comprehensive list of the filters is available here.

  • t
  • trans
  • placeholder
  • without
  • clean_class
  • clean_id
  • render
  • path
  • url
  • format_date
  • drupal_escape
  • safe_join

Functions

  • link
  • active_theme*
  • attach_library*

*These are dummy functions that don't do anything except keep Twig.js compilation from breaking when these Drupal-specific functions are used in Drupal Twig templates.

Readme

Keywords

Package Sidebar

Install

npm i twig-drupal-filters

Weekly Downloads

15,314

Version

3.2.0

License

MIT

Unpacked Size

10.2 kB

Total Files

15

Last publish

Collaborators

  • johnalbin
  • robloach
  • ryanweal
  • andrewmallis
  • amykhailova