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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   2014 Views

Avatar
fishe

Community Member, 42 Posts

13 January 2009 at 9:05pm

Edited: 13/01/2009 9:15pm

Hey

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>
	</div>
<% end_control %>

Can I not do this? Do I need to do something like shown here: http://doc.silverstripe.com/doku.php?id=imageupload#more_advanced_uses

Avatar
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