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

ImageDataObjectManager, get $width from first element


Reply

3 Posts   1039 Views

Avatar
patte

7 January 2010 at 2:43am Community Member, 63 Posts

Hi,

I want to get the $width property from the first Attachment.

<% if Screenshots %>
<% control Screenshots %>
   <h3>$Name</h3>
   <p>$Description</p>
   <% control Attachment %>$URL<% end_control %>
<% end_control %>
<% end_if %>

<% control Attachment %>$width<% end_control %> is working fine but returns the properties for all elements.

any idea? Thanks much!
patte

Avatar
UncleCheese

7 January 2010 at 2:52am 4085 Posts

Why not just..

<% control Screenshots %>
<% if First %>
$Attachment.Width
<% else %>
$Attachment.URL
<% end_if %>
<% end_control %>

Avatar
patte

7 January 2010 at 2:58am Community Member, 63 Posts

ahhh... thanks ;-)