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

Avatar
patte

Community Member, 63 Posts

7 January 2010 at 2:43am

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

Forum Moderator, 4096 Posts

7 January 2010 at 2:52am

Why not just..

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

Avatar
patte

Community Member, 63 Posts

7 January 2010 at 2:58am

ahhh... thanks ;-)