Sure,

Posts: 1312
Joined: 08/14/2007
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.

Thanks, glad you like the site Smiling

I used the Contemplate module to create a product template, or you could use node-product.tpl.php, I think. Here's the complete code with foreach loop - assuming you are using CCK to add your images (and have "Multiple" selected in your field's config).

<?php
   
foreach ($node->field_image_cache as $field) {
?>

<a href="/files/imagecache/thickbox/<?php print $field['filepath'];?>" class="thickbox" rel="field_image_cache_0" alt="<?php print $field['filename']; ?>" title="<?php print $field['filename']; ?>"><?php if($field['filepath'] == $field_image_cache[0]['filepath']) print '<img src="/files/imagecache/product/'.$field['filepath'].'" title="'.$field['filename'].'" alt="'.$field['filename'].'">'; ?></a>
<?php
   
}
?>

My only note is that, for portability sake, you might want to swap the "/files/imagecache" etc hard-coded directory locations for a dynamic base_path() and $field['filepath'] construction. I just haven't gotten around to revisiting my code yet Smiling (I would also change the Alt and Title tags to be whatever was specified in the image cache fields, if you have that configured.

So what this loop does, is goes through all of the attached files for that node, and checks if it's the first image ($field_image_cache[0]['filepath']).. If so, it prints that one large and hides all of the other ones, but adds them as elements in the Thickbox array. I can't remember how I figured it out exactly but when you have other links that include the "thickbox" class, it will include them all in the "slides" type presentation you see on our T-shirt product page.

Hope this helps! Feel free to tweak and modify to your heart's content.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com