Jump to:

23461 Posts in 18908 Topics by 2878 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: 1102 Views
  • fishe
    Community Member
    42 Posts

    GD Image functions in a template Link to this post


    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: http://doc.silverstripe.com/doku.php?id=imageupload#more_advanced_uses

  • Aram
    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

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.