5102 Posts in 1520 Topics by 1116 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1125 Views |
-
Template Syntax for specific Dataobject entry

22 June 2009 at 4:33pm
Hi all,
I'm setting up a website with the brilliant Dataobject Manager (but I don't think the question is specific to that). To get only the first (second, third) entry I use this template syntax:
<% control MediaAssets %>
<% if Pos=1 %>
$displayMediaAsset
<% end_if %>
<% end_control %>Is there any better way to get just a specific entry than this method without the <% if %> block?
I tried $displayMediaAsset.1 , $displayMediaAsset(1) , control MediaAssets(1) , control MediaAssets.1 but all of that doesn't work.
It's OK if I use the conditional if but I'm hoping there's a shorter solution.
Cheers!
Anatol -
Re: Template Syntax for specific Dataobject entry

22 June 2009 at 5:00pm Last edited: 22 June 2009 5:01pm
Yep - ".First":
<% control MediaAssets.First %>
$displayMediaAsset
<% end_control %> -
Re: Template Syntax for specific Dataobject entry

22 June 2009 at 5:22pm
Hi Hamish,
thank you for the reply. Yes, that works for the first Dataobject. What I'm looking for is something like
<% control MediaAssets.Pos(1) %>
$displayMediaAsset
<% end_control %>So the Position could be Pos(1), or Pos(2) or Pos(3) etc. But the code above doesn't do anything. What's the best way to write this?
Cheers!
Anatol
| 1125 Views | ||
|
Page:
1
|
Go to Top |

