Skip to content

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

License

Notifications You must be signed in to change notification settings

avblink/avb_twig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drupal Twig Extension by AVB Link

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'}) %}

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages