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


2 Posts   1112 Views


13 January 2009 at 9:05pm (Last edited: 13 January 2009 9:15pm), Community Member, 42 Posts


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

13 January 2009 at 10:14pm Community Member, 598 Posts

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