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

<?php
     
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

Files: 

Comments

drewish’s picture

Status:Needs review» Needs work

please roll a proper patch http://drupal.org/patch

thePanz’s picture

-- duplicated comment ---

thePanz’s picture

StatusFileSize
new815 bytes

This 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).

thePanz’s picture

Status:Needs work» Needs review

I forgot to change issue status.

drewish’s picture

Title:Class attribute for display» Pass class attribute to the non-linking formatters
Status:Needs review» Fixed
StatusFileSize
new949 bytes

Thanks, removed an extra space (that was there before the patch) and committed the attached to HEAD.

drewish’s picture

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.