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...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
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...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.