| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
duplicating and editing product_thumbnail.tpl to call alternative image | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() 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 |
|||||||||
#2
|
|||||||
|
|||||||
![]() 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 |
|||||||
#3
|
|||||||
|
|||||||
![]() 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 |
|||||||
#4
|
|||||||||
|
|||||||||
![]() 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 |
|||||||||
#5
|
|||||||
|
|||||||
![]() how about changing the thumnail to a detailed image?
garz 4.11
__________________
xcart ver 4.xx/linux/php |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|