View Single Post
  #7  
Old 10-09-2008, 12:22 AM
  Yurij's Avatar 
Yurij Yurij is offline
Banned
 

X-Adept
  
Join Date: Jan 2008
Posts: 486
 

Default Re: Define Thumbnail Height, Not Width

Quote:
Originally Posted by nft
I have had a look at product_thumbnail.tpl and I made the following changes:

Original File:

{* $Id: product_thumbnail.tpl,v 1.14 2004/06/24 09:53:29 max Exp $ *}
{if $config.Appearance.show_thumbnails eq "Y"}<IMG id="{$id}" src="{if $tmbn_url}{$tmbn_url}{else}{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?productid={$productid}{if $file_upload_data.file_path}&tmp=y{/if}{/if}"{if $image_x ne 0} width="{$image_x}"{/if}{if $image_y ne 0} height="{$image_y}"{/if} alt="{$product|escape}" border="0">{/if}

Modified File:

{* $Id: product_thumbnail.tpl,v 1.14 2004/06/24 09:53:29 max Exp $ *}
{if $config.Appearance.show_thumbnails eq "Y"}<IMG id="{$id}" src="{if $tmbn_url}{$tmbn_url}{else}{if $full_url}{$http_location}{else}{$xcart_web_dir}{/if}/image.php?productid={$productid}{if $file_upload_data.file_path}&tmp=y{/if}{/if}"{if $image_x ne 0} height="{$image_x}"{/if}{if $image_y ne 0} width="{$image_y}"{/if} alt="{$product|escape}" border="0">{/if}

You will notice in the modified file I have changed width="{$image_x}" to height="{$image_x}" and height="{$image_y}" to width="{$image_y}"

This did change the thumbnail height based on the width setting in the 'Appearance Options' however this resizes the thumb image in the product description which was not the case before.

Does anyone know how to modify the script so that only the thumb images are re sized in the directory listings etc and not in the product description ?

I find it strange that the thumb image in the product description is re sized after I make this change as it was not re sized with the original script.

Any assistance appreciated.

James

Open file skin1/customer/main/products.tpl (products_t.tpl) and find next line:

for products.tpl
PHP Code:
{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url

for products_t.tpl
PHP Code:
{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$products[product].tmbn_x|default:$config.Appearance.thumbnail_width image_y=$products[product].tmbn_y product=$products[product].product tmbn_url=$products[product].tmbn_url



change this line by this:

image_y=250 (fixed height for thumbnail)

for products.tpl
PHP Code:
{include file="product_thumbnail.tpl" productid=$products[product].productid image_y=250 product=$products[product].product tmbn_url=$products[product].tmbn_url

for products_t.tpl
PHP Code:
{include file="product_thumbnail.tpl" productid=$products[product].productid default:$config.Appearance.thumbnail_width image_y=250 product=$products[product].product tmbn_url=$products[product].tmbn_url


ps. File " product_thumbnail.tp" does not need to change!!!!
Reply With Quote