Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wondrousllc/fractal-twig-drupal-adapter

Package Overview
Dependencies
Maintainers
3
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wondrousllc/fractal-twig-drupal-adapter

Twig template adapter for Fractal with Drupal 8 directives.

  • 1.3.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Twig Adapter

An adapter to let you use Twig templates with Fractal.

Installation

$ npm install --save @wondrousllc/fractal-twig-drupal-adapter

in your fractal.js

const fractal = require('@frctl/fractal').create();
const twigAdapter = require('@wondrousllc/fractal-twig-drupal-adapter');
const twig = twigAdapter({
  handlePrefix: '@components/',
});

Usage

This adapter allows you to use some Drupal filters, functions and tags.

Supported Filters

|t - The Drupal core translation filter. Additional parameters not supported, yet.

|field_value - Provided by the module drupal/twig_field_value to use plain outputs from a field.

Add Custom Filters

You have the ability to extend Twig with custom filters by adding any filter functions to the twigAdapter configuration. The name of the function will be used as the filter name. For example, to create a |render filter:

const twig = twigAdapter({
  filters: {
    render(str) {
      return str;
    }
  }
});

Supported Functions

path() - The Drupal core path function.

url() - The Drupal core url function.

block_view() - Provided by the module drupal/twig_extender to directly print a block.

Supported tags

{% trans %} - The Drupal core translate tag.

Creator

WONDROUS Ltd

MIT License

FAQs

Package last updated on 30 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc