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

Avatar
aTTi

Community Member, 19 Posts

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

Avatar
Martijn

Community Member, 271 Posts

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

Avatar
UncleCheese

Forum Moderator, 4096 Posts

25 August 2010 at 2:12am

Edited: 25/08/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 %>

Avatar
aTTi

Community Member, 19 Posts

25 August 2010 at 2:19am

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