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.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, biapar, Willr, Ingo, swaiba, simon_w

DataObject Image Issue


Reply

4 Posts   1183 Views

Avatar
aTTi

25 August 2010 at 12:49am Community Member, 19 Posts

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

Avatar
Martijn

25 August 2010 at 12:57am Community Member, 271 Posts

Better add a method to perform the cropping:

if Slideshow has_one Image

function Thumbnail(){
      return $this->Image()->CroppedImage(250,250);
   }

in template $Thumbnail

Avatar
UncleCheese

25 August 2010 at 2:12am (Last edited: 25 August 2010 2:13am), 4085 Posts

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 %>

Avatar
aTTi

25 August 2010 at 2:19am Community Member, 19 Posts

Thanks for the fast answers, it works like a charm now :-)