I have an object called 'attributes' available to me in a twig template. Given that the following:

{{ dump(attributes) }}
{{ dump(attributes.storage) }}
{{ dump(attributes.storage['data-quickedit-field-id']) }}

dumps this:

enter image description here

how do I access the value property:?


I've tried the obvious:

{{ dump(attributes.storage['data-quickedit-field-id'].value) }}

The following methods are available to me:

enter image description here

2 Answers 2


You can pipe it to render:

{{ attributes.storage['data-quickedit-field-id']|render }}

You can use offsetGet and render :

{{ attributes.offsetGet('data-quickedit-field-id')|render  }}

Source : https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Template%21Attribute.php/function/Attribute%3A%3AoffsetGet/8.2.x

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.