Download & Extend

Pass class attribute to the non-linking formatters

Project:ImageCache
Version:6.x-2.0-beta1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

Comments

#1

Status:needs review» needs work

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

#2

-- duplicated comment ---

#3

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

AttachmentSizeStatusTest resultOperations
imagecache_add_display_class.patch815 bytesIgnored: Check issue status.NoneNone

#4

Status:needs work» needs review

I forgot to change issue status.

#5

Title:Class attribute for display» Pass class attribute to the non-linking formatters
Status:needs review» fixed

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

AttachmentSizeStatusTest resultOperations
imagecache_322155.patch949 bytesIgnored: Check issue status.NoneNone

#6

#7

Status:fixed» closed (fixed)

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

nobody click here