Jump to:

22992 Posts in 11842 Topics by 2828 members

General Questions

SilverStripe Forums » General Questions » GD Image functions in a template

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

Page: 1
Go to End
Author Topic: 1071 Views
  • fishe
    Avatar
    Community Member
    42 Posts

    GD Image functions in a template Link to this post

    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

  • Aram
    Avatar
    Community Member
    598 Posts

    Re: GD Image functions in a template Link to this post

    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

    1071 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.