7921 Posts in 1359 Topics by 933 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » DataObject Image Issue
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 976 Views |
-
DataObject Image Issue

25 August 2010 at 12:49am
Hello folks!
I'm having a problem with the DOM.
I created a DataObject called "Slideshow".
Now i would like to display all those images on the Page e.g
<% control Slideshow %>
<% control CroppedImage(550,211) %>
<img src="$URL" alt="" class="cycle" />
<% end_control %>
<% end_control %>But this does not work, i can't get the right <img src="">
Does i miss something?
Greetz
aTTi
-
Re: DataObject Image Issue

25 August 2010 at 12:57am
Better add a method to perform the cropping:
if Slideshow has_one Image
function Thumbnail(){
return $this->Image()->CroppedImage(250,250);
}in template $Thumbnail
-
Re: DataObject Image Issue

25 August 2010 at 2:12am Last edited: 25 August 2010 2:13am
Look closely at your control.. You never refer to the image that is associated with that DataObject. There is no method "CroppedImage" on your slideshow object.
<% control Slideshow %>
<% control YourImageField %>
<% control CroppedImage(550,211) %>
<img src="$URL" alt="" class="cycle" />
<% end_control %>
<% end_control %>
<% end_control %> -
Re: DataObject Image Issue

25 August 2010 at 2:19am
Thanks for the fast answers, it works like a charm now
| 976 Views | ||
|
Page:
1
|
Go to Top |


