Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Define Thumbnail Height, Not Width

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-11-2006, 05:53 PM
 
nft nft is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 52
 

Default 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
__________________
X-Cart Pro 4.1.9
FreeBSD
Apache
MySQL 5
PHP 4.4.8
Reply With Quote
  #2  
Old 09-12-2006, 02:44 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Define Thumbnail Height, Not Width

Just edit product_thumbnail.tpl and hard-code the height in there.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 09-12-2006, 07:37 PM
 
nft nft is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 52
 

Default 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
__________________
X-Cart Pro 4.1.9
FreeBSD
Apache
MySQL 5
PHP 4.4.8
Reply With Quote
  #4  
Old 10-03-2008, 09:20 AM
  Madhatterr's Avatar 
Madhatterr Madhatterr is offline
 

eXpert
  
Join Date: Jan 2007
Posts: 202
 

Default 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!
__________________
DeAnna Ross
http://madhatterrgames.com [v.4.1.8] Fashion Template
http://www.hortonstores.com [v.4.1.12] Fashion Mosaic Skin
http://teststore.hortonstores.com [v.4.2.2] Fashion Mosaic Skin TEST STORE - NOT FOR ACTUAL SHOPPING!
Reply With Quote
  #5  
Old 10-07-2008, 06:29 AM
  Madhatterr's Avatar 
Madhatterr Madhatterr is offline
 

eXpert
  
Join Date: Jan 2007
Posts: 202
 

Default Re: Define Thumbnail Height, Not Width

*polite bump*
__________________
DeAnna Ross
http://madhatterrgames.com [v.4.1.8] Fashion Template
http://www.hortonstores.com [v.4.1.12] Fashion Mosaic Skin
http://teststore.hortonstores.com [v.4.2.2] Fashion Mosaic Skin TEST STORE - NOT FOR ACTUAL SHOPPING!
Reply With Quote
  #6  
Old 10-08-2008, 04:30 AM
 
nft nft is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: Sydney, Australia
Posts: 52
 

Default 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
__________________
X-Cart Pro 4.1.9
FreeBSD
Apache
MySQL 5
PHP 4.4.8
Reply With Quote
  #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
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 03:49 PM.

   

 
X-Cart forums © 2001-2020