All Projects → wearewondrous → fractal-twig-drupal-adapter

wearewondrous / fractal-twig-drupal-adapter

Licence: MIT license
Twig template adapter for Fractal with Drupal 8 directives.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to fractal-twig-drupal-adapter

DrupalTwigFood
Useful functions, filters for twig @ Drupal 8
Stars: ✭ 1 (-92.31%)
Mutual labels:  twig, drupal, drupal-8
migrate source example
Example module for Drupal 8 that provides migrations of users, terms, files and nodes from database, JSON resources, CSV and XML files. #migrate
Stars: ✭ 39 (+200%)
Mutual labels:  drupal, drupal-8
dkan2
Deprecated: please use the 2.x branch of the dkan repo
Stars: ✭ 17 (+30.77%)
Mutual labels:  drupal, drupal-8
docker-drupal
Docker scaffolding for Drupal 8
Stars: ✭ 41 (+215.38%)
Mutual labels:  drupal, drupal-8
distros.bid
A saas to create drupal websites in seconds using docker containers.
Stars: ✭ 16 (+23.08%)
Mutual labels:  drupal, drupal-8
drupal8-composer-template
Project template for Drupal 8 projects with composer | Quick installation via "composer create-project woprrr/drupal8-composer-template:8.3.0"
Stars: ✭ 27 (+107.69%)
Mutual labels:  drupal, drupal-8
varbase
Built using Drupal 8/9, an enterprise website builder platform that combines powerful editorial features, mobile, lead-generation, SEO, social media integration, and beautiful bespoke designs. Varbase is packed with adaptive functionalities and essential modules.
Stars: ✭ 75 (+476.92%)
Mutual labels:  drupal, drupal-8
gatsby-drupal-kit
A Gatsby V2 starter kit designed to work with a new Drupal 8 site.
Stars: ✭ 23 (+76.92%)
Mutual labels:  drupal, drupal-8
Idea Php Symfony2 Plugin
IntelliJ IDEA / PhpStorm Symfony Plugin
Stars: ✭ 797 (+6030.77%)
Mutual labels:  twig, drupal
Idea Php Drupal Symfony2 Bridge
PhpStorm plugin to support Symfony components inside Drupal 8
Stars: ✭ 34 (+161.54%)
Mutual labels:  twig, drupal
drupal-react-image-gallery
Drupal 8 module that provides a dynamic Image Gallery based on the react-image-gallery component.
Stars: ✭ 13 (+0%)
Mutual labels:  drupal, drupal-8
Bolt
The Bolt Design System provides robust Twig and Web Component-powered UI components, reusable visual styles, and powerful tooling to help developers, designers, and content authors build, maintain, and scale best of class digital experiences.
Stars: ✭ 186 (+1330.77%)
Mutual labels:  twig, drupal
apigee-devportal-kickstart-drupal
A fast demo and starting point for Apigee Developer Portals for Drupal
Stars: ✭ 21 (+61.54%)
Mutual labels:  drupal, drupal-8
shila-drupal-theme
Atomic design and Pattern Lab friendly, component-based, fairly unopinionated starting point for new Drupal themes
Stars: ✭ 81 (+523.08%)
Mutual labels:  drupal, drupal-8
drupal8-vagrant
Simple Drupal 8 Development Environment
Stars: ✭ 59 (+353.85%)
Mutual labels:  drupal, drupal-8
drupal8-employee-crud-module
No description or website provided.
Stars: ✭ 16 (+23.08%)
Mutual labels:  drupal, drupal-8
composer-tutorial
A walk through of various Composer tasks
Stars: ✭ 40 (+207.69%)
Mutual labels:  drupal, drupal-8
drupal-composer-init
Initialise a Drupal composer setup
Stars: ✭ 43 (+230.77%)
Mutual labels:  drupal, drupal-8
drupal-template-helper
Debug Drupal 8 templates in Chrome Devtools. drupal-template-helper is a chrome extension for Drupal that lists all available templates and the preprocess hooks to use to customize your templates.
Stars: ✭ 115 (+784.62%)
Mutual labels:  twig, drupal
Droopler
Stars: ✭ 46 (+253.85%)
Mutual labels:  twig, drupal

Twig Adapter

An adapter to let you use Twig templates with Fractal.

Installation

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

in your fractal.js

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

fractal.components.engine(twig);
fractal.components.set('ext', '.twig'); 

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

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].