Re: Re: Images on products pages not clickable? .. I'm using Lig

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

Here's how I did it. The main thing is to include the class="thickbox" attribute.

<a href="/<?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>

I used the fields from Contemplate to populate the link, that way your Alt tags and href Title uses whatever value you've got for a filename. You could change this up to include the node title if you want (using $node->nid).

Hope this helps.

For an example check out something from our catalogue: http://shop.rifftrax.com/rifftrax/jurassic-park (click on the poster to get the large version). I also have multiple images on some products (go to Gift Shop > Apparel > Logo T-shirt and check that out): http://shop.rifftrax.com/apparel/logo-t-shirt ... and that's done by using a foreach loop.

--

"Pain don't hurt." - Dalton

Mike Nelson's RiffTrax! www.rifftrax.com