Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
image system
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Feb 2012 at 11:37 UTC
Updated:
9 Mar 2012 at 13:16 UTC
I would like to add a couple of lines of code to the theme_image_formatter function found in image.field.inc which would allow attributes set on render arrays to be passed onto the theme image functions: -
// Do not output an empty 'title' attribute.
if (drupal_strlen($item['title']) > 0) {
$image['title'] = $item['title'];
}
+ // Pass on any attributes
+ if(isset($item['attributes'])) {
+ $image['attributes'] = $item['attributes'];
+ }
if ($variables['image_style']) {
$image['style_name'] = $variables['image_style'];
Sorry for not adding a patch - it isn't easy for me to do here :-(
Comments
Comment #1
esbite commentedJust found this has already been committed to core. Happy day!
http://drupal.org/node/1329586