Skip to content

Instantly share code, notes, and snippets.

@robdecker
Created December 8, 2019 04:46
Show Gist options
  • Save robdecker/ea43ff46935a5715f7cb3e87cf7b86e5 to your computer and use it in GitHub Desktop.
Save robdecker/ea43ff46935a5715f7cb3e87cf7b86e5 to your computer and use it in GitHub Desktop.
[Twig modules] #d8 #twig

Value

Simplified Twig template variables for Drupal

Bamboo Twig

The Bamboo Twig module provides some Twig extensions with some useful functions and filters aimed to improve the development experience.

Bamboo Twig has a lot of advantages and brings a lot of new features to the Twig landscape of Drupal 8. It boosts performance by using lazy loading, improves the code quality with automated workflow. It also includes automated unit and kernel tests to ensure stability.

Twig field value

Twig Field Value allows Drupal 8 themers to get partial data from field render arrays. It gives them more control over the output without drilling deep into the render array or using preprocess functions.

Twig tweak

Twig tweak is a small module which provides a Twig extension with some useful functions and filters that can improve development experience.

Twig extensions

The Twig Extensions is a library that provides several useful extensions for Twig.

Twig extender

Add a simple plugin system to add new twig extensions (Filter and Functions). Provides a new service provider for "twig.extensions" to add new plugins.

More Global Variables

This is a small module that gives users some global variables that can be then printed in any twig template. For example, if you wanted to print the current page title as the last menu in a breadcrumb, you could print {{ global_variables.current_page_title }} in breadcrumb.html.twig. It can also be printed in any other template - html.html.twig, page.html.twig, node.html.twig, field.html.twig, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment