how can i add a class to the image? (eg class="imageclass")
Not the link.

Thanks for your help!

  $img = theme( 'imagecache', 'front_page_block', $node->content['field_image']['field']['items'][0]['#item']['filepath'] ); 
  print l($img, $node->field_link[0]['display_url'] , array( 'html' => 'true' , 'attributes' => array('alt' => $node->title, 'title' => $node->title )));

Comments

mm167’s picture

what theme u are using?

nimzie’s picture

my own, but it's a sub of zen.

nathanjo’s picture

from your code:

$img = theme( 'imagecache', 'front_page_block', $node->content['field_image']['field']['items'][0]['#item']['filepath'] );

you just need to add attributes:

$img = theme( 'imagecache', 'front_page_block', $node->content['field_image']['field']['items'][0]['#item']['filepath'], '', '', array('class' => CLASSNAME));
nimzie’s picture

thanks! i just couldn't figure out the d6 syntax again :S ..

cheers,
Adam

Harpo’s picture

In what file is this line of code located? Just posted a new topic trying to find out how to add a class to images using ImageCache, this looks like a solution!

Thanks,
Harpo