Jump to:

3434 Posts in 1026 Topics by 866 members

Template Questions

SilverStripe Forums » Template Questions » Nested Image Controls

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

Page: 1
Go to End
Author Topic: 627 Views
  • pinkp
    Avatar
    Community Member
    168 Posts

    Nested Image Controls Link to this post

    How can i nest a control in my loop:

    <% loop Images %>
             <div class="GalleryImage">
                <span><h3>$ImageTitle</h3></span>
                   <a class="fancybox" data-fancybox-group="gallery" href="$Filename" title="$ImageTitle $ImageSubTitle">
             $CroppedImage({$Top.WidthImage})
                   </a>
    <% end_loop %>

    This does't work, I want to have a cropped image and allow the user to control the sizes in the CMS.

    $CroppedImage(280,140)
    $CroppedImage({$Top.WidthImage})

    thanks

  • Bambii7
    Avatar
    Community Member
    254 Posts

    Re: Nested Image Controls Link to this post

    This is a little old you may have solved this by now. If now, you try resizeByHeight

    $image->resizeByHeight(height)

    croppedImage expects two arguments width & height. SS image docs

    627 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.