View Single Post
  #46  
Old 01-09-2008, 02:21 AM
 
sk8conz sk8conz is offline
 

Advanced Member
  
Join Date: Dec 2007
Posts: 31
 

Default Re: Thickbox 2.0 implementation

Edit: My Code is for Thickbox version 3 or 3.1

I tried this wonderful mod and had the same problem with multiple images not wrapping. I have a working version that gracefully wraps and lets you specify how many images per row before wrapping.

New thickbox_productpage.tpl

PHP Code:
{if $images ne ""}
<
div style="white-space:nowrap;color:#D90000;font-weight:bold;padding:2px;margin:10px 0 4px;">{$lng.lbl_detailed_images} &not;</div>
<
table width="250"><tr>
{
assign var=loop value=1}
{
section name=image loop=$images}
<
td class = image_bdr>
{if 
$images[image].avail eq "Y"}
{if 
$images[image].tmbn_url
<
div style="white-space: nowrap;padding:0 0 1px 3px;"><a href="{$images[image].tmbn_url}title={$images[image].alt|escape}class="thickbox" rel="lightbox_detailed"><img src="{$images[image].tmbn_url}width="100" style="border:0;" alt="{$lng.lbl_click_to_enlarge|escape}/> </a></div>
{else}
<
div style="white-space: nowrap;padding:0 0 1px 3px;"><a href="{$xcart_web_dir}/image.php?id={$images[image].imageid}&amp;type=D" title={$images[image].alt|escape}class="thickbox" rel="lightbox_detailed"><img src="{$SkinDir}/thickbox/files/zoom.gif" style="border:0;" alt="{$lng.lbl_click_to_enlarge|escape}/> {$images[image].alt|escape}{if $images[image].alt|escape eq ""} {$lng.lbl_image} {math equation="value+1" value=$smarty.section.image.index}{/if}</a></div>
{/if}
{/if}
</
td>
{* 
change the number below for how many images wide you want *}
{if 
$loop eq 5} </tr><tr> {assign var=loop value=0}
{/if}
{
assign var=loop value=$loop+1}
{/
section}</tr>
</
table>
<
script type="text/javascript" src="{$SkinDir}/thickbox/files/jquery-compressed.js"></script>
<
script type="text/javascript" src="{$SkinDir}/thickbox/files/thickbox.js"></script>
<
style type="text/css" media="all">@import "{$SkinDir}/thickbox/files/thickbox.css";</style>
{/if} 


You also need to change the location of the thickbox_productpage.tpl include in the customer\main\product.tpl file

PHP Code:
</table>
{include 
file="thickbox/thickbox_productpage.tpl" }
<
input type="hidden" name="productid" value="{$product.productid}/>
<
input type="hidden" name="cat" value="{$smarty.get.cat|escape:"html"}/>
<
input type="hidden" name="page" value="{$smarty.get.page|escape:"html"}/> 

On 4.1.9 this code is around line 208

Hope this helps someone
Attached Images
File Type: jpg snapshot.jpg (40.7 KB, 73 views)
__________________
4.3.1
rounded white template
one page checkout
Reply With Quote