Print field_images field tpl in node
Hy,
i try the following and it works:
<?php
print render($content['product:field_images']);
?>
I need now, to be able to address each image and print some stuff inside the tag, so i tried:
<?php
$my_images = $node->field_images;
if (count($my_images)>0) :
foreach ($my_images as $my_image) :
$image = theme('imagecache', 'product_full', $my_image['filepath'], $my_image['data']['alt'], $my_image['data']['title']);
print $image;
endforeach;
endif;
?>
But it doesn´t work. Any suggestions?
Is that the right way, or am i totally off track?
Best Sam
Comments
One question
Hi
Could you explain a little more what do you want to achieve?
Maybe you can do it without modify the .tlp file
Are you using commerce kickstart 2.0?
There's a way to activate the alt and title field for images without modify the .tpl
file that's why I asked you about what do you want to do
Thanks
One answer
Hy realskorpion, what i want is to implement google´s rich snippets, that means i need to set up a code for the first image that´s available. Images for products are created with max 3 different images, so it would be perfect to implement the rich snippet in the first one only. Ideally there would be a way to print image01, image02, image03 (if available) and than add the rich snippet code to the first one.
I´m using latest commerce kickstart 2.0
Maybe you can start here
Hi
Did you check these?
http://openspring.net/blog/2011/09/30/schemaorg-rich-snippets-drupal-7-rdfa
http://www.drupalcommerce.org/discussions/5377/rich-snippets-drupal-comm...
http://groups.drupal.org/node/181659
Thanks
Uuuu... nice! I will try, thx
Uuuu... nice! I will try, thx a lot!!!