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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Template Questions /

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

Nested Image Controls


Go to End


2 Posts   1196 Views

Avatar
pinkp

Community Member, 182 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. SS image docs