X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Define Thumbnail Height, Not Width (https://forum.x-cart.com/showthread.php?t=24827)

nft 09-11-2006 05:53 PM

Define Thumbnail Height, Not Width
 
Hello,
Is anyone aware of how to define the Thumbnail by Height and not width ?

Any assistance is appreciated.

James

balinor 09-12-2006 02:44 AM

Re: Define Thumbnail Height, Not Width
 
Just edit product_thumbnail.tpl and hard-code the height in there.

nft 09-12-2006 07:37 PM

Re: Define Thumbnail Height, Not Width
 
Quote:

Originally Posted by balinor
Just edit product_thumbnail.tpl and hard-code the height in there.


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

Madhatterr 10-03-2008 09:20 AM

Re: Define Thumbnail Height, Not Width
 
Anyone got an answer to James' question? I could definately use this particular fix as the thumbnails our company provides us with are varried in size and some of them are far longer than they are wide and being able to set the height instead of width would fix the issue completely.

Thanks!

Madhatterr 10-07-2008 06:29 AM

Re: Define Thumbnail Height, Not Width
 
*polite bump*

nft 10-08-2008 04:30 AM

Re: Define Thumbnail Height, Not Width
 
Hi,

I ended up obtaining a custom image resize modification from Qualiteam which also ensures that the image does not appear jagged or degraded in quality.

The modification basically creates a new thumb nail and detailed image and resizes them to specification. I think it uses GDLib on apache.

I am sure that there will be other mods out there that do something similar.

Regards,

James Long

Yurij 10-09-2008 12:22 AM

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!!!!


All times are GMT -8. The time now is 04:32 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.