Hello guys i made a field getting the first image from a multivalue cck image field , and it worked perfect but i tried to use theme function to use an image cache but it didnt work can i add a formatter to any field i made ??

i tried this code

print theme('imagecache', ‘galleryformatter_thumb’,$object->field_images_property[0]['filepath'], $alt, $title, $attributes); 

and didn't work

but when i used this code
Only local images are allowed.field_images_property[0]['filepath'] ?>" />
it worked perfect but i cannot controll the image by using imagecache

any idea or solution for this?

Comments

swentel’s picture

Title: display suite field and image cache » Calling theme('imagecache') from code
Project: Display Suite » ImageCache
Version: 6.x-1.x-dev » 6.x-2.x-dev
Category: feature » support

Works perfectly for me, had a test with a preset called 'small':

return theme('imagecache', 'small', $object->field_image[0]['filepath']);

The 'backticks' in your function might be the problem ...

Moving to imagecache queue - for anyone looking at the code, $object is the same as $node.

sabrawy’s picture

im gonna try it , i think u used return & i used print like tpl themming method.
i'm goint to let you know if worked .

thank you very much.

sabrawy’s picture

Confirm It wasn't working because i used "print" and when i changed it to "return" it worked like a charm .
Thank you very much for helping.

fizk’s picture

Status: Active » Closed (fixed)

Please reopen if this is still an issue with ImageCache 6.x-2.0-rc1.