![]() |
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. |
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} |
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} |
Re: duplicating and editing product_thumbnail.tpl to call alternative image
Groovey, that worked very nicely. Thanks!
|
Re: duplicating and editing product_thumbnail.tpl to call alternative image
how about changing the thumnail to a detailed image?
garz 4.11 |
All times are GMT -8. The time now is 09:35 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.