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.

General Questions /

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

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

GD Image functions in a template


Reply


2 Posts   1147 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