5102 Posts in 1520 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 782 Views |
-
Image gallery - how to resize

18 March 2009 at 7:57pm Last edited: 18 March 2009 8:00pm
Hi
I need to resize the images in my gallery before sending them to the client browser. The images have sizes of 500 kb (but resized only about 50 kb).
I have in Page.php created a function
function FrontPageRotator() {
return DataObject::get("Image", "`ParentID` = 31");
}And in Page.ss the following template code
<% if FrontPageRotator %>
<% control FrontPageRotator %>
<img class="frame" src="$Link" style="display:<% if First %>block;<% else %>none;<% end_if %>" width="270" height="220"/>
<% end_control %>
<% end_if %>I wanted to have $Image.setWidth(140) instead of $Link, but I dont seem to be able to refer to $Image.
Can anyone help?Thanks in advance.
Best regards Trym
| 782 Views | ||
|
Page:
1
|
Go to Top |

