Detailed Product Image Mod
xcart version 4.0.11
I had a need to list detailed images horizontally rather than vertically, display the alt text under each image, and I had to get the images to break at a certain size.
The code below is a modified product_images.tpl. Based on image size (mine being 100 X 100 pixals) you can modify the {if $count==5} line to however many images you wished displayed horizontally.
Modified code is in green
{if $images ne ""}
{capture name=dialog}
<DIV align="center">
<table border="0" width="100" id="table1" cellspacing="0" cellpadding="0">
<tr>
{section name=image loop=$images}
{if $images[image].avail eq "Y"}
{assign var="count" value="`$count+1`"}
{if $images[image].tmbn_url}
[img]{$images[image].tmbn_url}[/img]
{$images[image].alt|escape}
{else}
<td>
<p align="center">
[img]{$xcart_web_dir}/product_image.php?imageid={$images[image].imageid}[/img]
{$images[image].alt|escape}
</td>
{if $count==5}
{assign var="count" value="0"}
</tr>
<tr>
{/if}
[/color]
{/if}
{/if}
{/section}
</DIV>
</tr>
</table>
{/capture}
{if $smarty.capture.dialog ne ""}
{include file="dialog.tpl" title=$lng.lbl_detailed_images content=$smarty.capture.dialog extra="width=100%"}
{/if}
{/if}
|