Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Usually I have this:
foreach (dynamic item in Model.images) { <img src="@Model.MediaById(item.image).umbracoFile" alt="" /> }
But this time I always have two items in the control so I want to create an array instead of a foreach loop.
How do I create an array of the Mode.images and get the [0] and [1] item?
Instead, why not try: @Model.images.First() or @Model.images.Take(1) and Model.images.Skip(1).Take(1)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Create array from Embedded Content?
Usually I have this:
But this time I always have two items in the control so I want to create an array instead of a foreach loop.
How do I create an array of the Mode.images and get the [0] and [1] item?
Instead, why not try: @Model.images.First() or @Model.images.Take(1) and Model.images.Skip(1).Take(1)
is working on a reply...