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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Template Questions /

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

Nested Image Controls


Go to End


2 Posts   1540 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