Accessing image field attributes twig in Drupal 8

You are here

To access image field attributes in Drupal 8 you can call the kint() function that is in the devel module. You can access all sorts of information, one that can be really useful is the title tag.

 // See inside image array
 {{kint(image)}}

 // See title string
 {{kint(image['#attributes'].title)}}

  // Print string inside template
 <span> {{image['#attributes'].title}}</span>