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.

Template Questions

Nested Image Controls


Reply

2 Posts   649 Views

Avatar
pinkp

26 February 2013 at 11:42pm (Last edited: 26 February 2013 11:43pm), Community Member, 168 Posts

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

Avatar
Bambii7

27 June 2013 at 3:51pm (Last edited: 27 June 2013 4:06pm), Community Member, 254 Posts

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. [url=http://doc.silverstripe.org/framework/en/reference/image]SS image docs[/url]