avblink/avb_twig

There is no license information available for the latest version (v1.0.2) of this package.

Drupal 8 Twig Extension. Provides custom twig functions and filters.

Installs: 1 104

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:drupal-module

v1.0.2 2020-05-28 15:34 UTC

This package is auto-updated.

Last update: 2024-04-29 00:32:06 UTC


README

Contains Drupal Twig functions and filters.

  • Get current entity from path.
{% set node = avb_twig_current_entity('node') %}
  • Assign new Attribute() class to a variable
{% set attributes = avb_twig_create_attribute(['class', ['class1', 'class2']]) %}
{{ avb_twig_create_attribute().addClass(['class1', 'class2'])}}
  • Add 'style' attribute
{% set attributes = avb_twig_create_attribute().addStyle({'background-color': 'red'}) %}