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

duplicating and editing product_thumbnail.tpl to call alternative image

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 06-28-2008, 11:43 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default duplicating and editing product_thumbnail.tpl to call alternative image

Hi all,

If there is an easier way to do this I am all ears. What I am attempting to do is call a second version of a product thumbnail when a product is displayed in the center column of my site, as opposed to the thumbnail I'm showing in 'bestsellers' in my right column. The where doesn't really matter, just that I want to be able to call two separate versions depending on where the content is to be displayed.

The reason I'm doing this is because on the right column of my store the background is very dark, and in the center column the background is white. Because of either drop shadows or just image crispness I need to be able to create two versions of each thumb, one with a dark background and another with a white background.

What I've been looking at is the product_thumbnail.tpl. It is easy enough to copy this, but where I'm getting stuck is how to add an extra bit of code to there which would output something like '_white' into the call of the filename. Since I'm in control of where the content is displayed, I can manually edit whether I want to display the regular product_thumbnail.tpl or the modified one that would be edited to call images with the '_white' filename.

Again, there may be a way more obvious way to do this and I'm all ears if there is.
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #2  
Old 06-29-2008, 05:34 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: duplicating and editing product_thumbnail.tpl to call alternative image

Change this snippet in your copy of product_thumbnail.tpl:
src="{if $tmbn_url}{$tmbn_url}{else}

to:
src="{if $tmbn_url}{$tmbn_url}_white{else}
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #3  
Old 06-29-2008, 05:38 AM
 
geckoday geckoday is offline
 

X-Wizard
  
Join Date: Aug 2005
Posts: 1,073
 

Default Re: duplicating and editing product_thumbnail.tpl to call alternative image

Whoops, forgot about the .jpg at the end of the file name. Assuming all of you images are .jpg replace with this:
src="{if $tmbn_url}{$tmbn_url|replace:".jpg":"_white.jpg"}{ else}
__________________
Manuka Bay Company
X-Cart Version 4.0.19 [Linux]

UGG Boots and other fine sheepskin products
http://www.snowriver.com
Reply With Quote
  #4  
Old 06-29-2008, 01:28 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Re: duplicating and editing product_thumbnail.tpl to call alternative image

Groovey, that worked very nicely. Thanks!
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #5  
Old 12-05-2008, 11:19 AM
 
gargonzo gargonzo is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 171
 

Default Re: duplicating and editing product_thumbnail.tpl to call alternative image

how about changing the thumnail to a detailed image?

garz
4.11
__________________
xcart ver 4.xx/linux/php
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 02:22 PM.

   

 
X-Cart forums © 2001-2020