Change record status: 
Introduced in branch: 

Attribute objects can now be printed multiple times, and printing out individual attributes (for example the class attribute) from the Attribute object no longer marks the individual attribute as printed. The Twig "without" filter can be used to prevent attributes from being printed. This change makes attributes within Twig templates behave the same as render arrays.


{{ attributes }} prints out everything but the class attribute because the class attribute has already been printed (via {{ attributes.class }} and marked as printed.

<div class="{{ attributes.class }} my-custom-class"{{ attributes }}>

{{ attributes }} always prints out all the attributes. When printing out individual attributes to customize them within a template, use the "without" filter to prevent attributes that have already been printed from being printed again.

<div class="{{ attributes.class }} my-custom-class"{{ attributes|without('class') }}>

You can also prevent multiple attributes from being printed:

{{ attributes|without('class', 'id', 'role') }}
Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other updates done