Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, I noticed that using Imagecache and setting to "Display PRESET_NAME image" displayed image don't have any "Class" attribute setted.
I changed imagecache.module in line 630/631 to
default:
return theme('imagecache', $presetname, $item['filepath'], $item['data']['alt'], $item['data']['title'], array('class' => $class));
solves my issue.
Maybe the preferred solution to have a setting for preset about "class" or other HTML attributes.
Regards
Comment | File | Size | Author |
---|---|---|---|
#5 | imagecache_322155.patch | 949 bytes | drewish |
#3 | imagecache_add_display_class.patch | 815 bytes | thePanz |
Comments
Comment #1
drewish CreditAttribution: drewish commentedplease roll a proper patch http://drupal.org/patch
Comment #2
thePanz CreditAttribution: thePanz commented-- duplicated comment ---
Comment #3
thePanz CreditAttribution: thePanz commentedThis is my patch. It's a simple one, but maybe themers or sites admin need more advanced way to set an imagecache IMG class attribute!
Regards!
my patch is against latest HEAD CVS version (I didn't find any drupal--6 branch).
Comment #4
thePanz CreditAttribution: thePanz commentedI forgot to change issue status.
Comment #5
drewish CreditAttribution: drewish commentedThanks, removed an extra space (that was there before the patch) and committed the attached to HEAD.
Comment #6
drewish CreditAttribution: drewish commentedmarked #309221: image class not showing in teaser as a duplicate