Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

GD Image functions in a template

Go to End

2 Posts   1543 Views


Community Member, 42 Posts

13 January 2009 at 9:05pm

Edited: 13/01/2009 9:15pm


My code here seems to be causing the page not to load anything...

<% control Children %>
	<div class="panel">
		<a href="$Link">$OutfitImage1.resizeByWidth(280)</a>
<% end_control %>

Can I not do this? Do I need to do something like shown here:

Carbon Crayon

Community Member, 598 Posts

13 January 2009 at 10:14pm

Hi Fishe

try this: $OutfitImage1.SetWidth(280)

The image functions which resize images in this way do not have the same names as the $gd functions for some reason. You can see all of these functions by looking in sapphire/core/model/image.php