1999 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Size of images in ecommerce
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1077 Views |
-
Size of images in ecommerce

20 January 2009 at 11:47pm
Hey
I think i may be having trouble with somthing which is actualy quite simple, im trying to set the thumbnails on products pages to be 200px wide (currently 100px). How would i go about doind this? iv tried $Image.SetWidth(200) but that didnt work. Any ideas on how to do this?
Thanks
-
Re: Size of images in ecommerce

21 January 2009 at 4:43am
Hey,
Bit of an update iv kinda managed to fix the problem but its a bit of a hack, at the moment im haveing to put this code in my template file
<!-- $Image.SetWidth(200); -->
<img src="assets/Uploads/_resampled/SetWidth200-{$Image.Name}" class="jqzoom" alt="$Image.Filename" />The first line is needed to generate the regenerated image but is commented out in the html to prevent it being displayed as i need the image to have class="jqzoom" this is a bit of a hack as the resulting html looks like
<!-- <img src="/assets/Uploads/_resampled/SetWidth200-IMG4672.jpg" alt="" />; -->
<img src="assets/Uploads/_resampled/SetWidth200-IMG4672.jpg" class="jqzoom" alt="assets/Uploads/IMG4672.jpg" />any ideas on how to do it withour the hack?
-
Re: Size of images in ecommerce

21 January 2009 at 3:02pm
You can loop over the Image with a Control
<% control Image.SetWidth(200) %>
<img src="$URL" class="jqzoom" alt="$Title" />
<% end_control %>Or you will have to do
<% control Image %>
<% control SetWidth(200) %>
<img src="$URL" class="jqzoom" alt="$Title" />
<% end_control %>
<% end_control %> -
Re: Size of images in ecommerce

22 January 2009 at 12:01am
Thanks the top option should do what i want and make the output a lot cleaner
.
Il have to look into <% control a bit more, didnt realize could do that sort of thing with it
| 1077 Views | ||
|
Page:
1
|
Go to Top |


