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   726 Views

Avatar
pinkp

Community Member, 168 Posts

26 February 2013 at 11:42pm

Edited: 26/02/2013 11:43pm

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

Community Member, 254 Posts

27 June 2013 at 3:51pm

Edited: 27/06/2013 4:06pm

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]