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
How can I iterate through children of a Media node, but only of certain types (ie, images). This line of code catches all item types.
@foreach(var item in Model.MediaById(myId).Children){...}
Preferably I would like a method so I can define more than one media type (images and files for instance)
Hi,
You should be able to do something like this:
@foreach(var item in Model.MediaById(1050).Children.Where("NodeTypeAlias == \"Image\" || NodeTypeAlias == \"File\""))
HTH,Tom
Alright. I will give that a shoot.
Thanks.
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
Iterating media items by type
How can I iterate through children of a Media node, but only of certain types (ie, images). This line of code catches all item types.
@foreach(var item in Model.MediaById(myId).Children){...}
Preferably I would like a method so I can define more than one media type (images and files for instance)
Hi,
You should be able to do something like this:
HTH,
Tom
Alright. I will give that a shoot.
Thanks.
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.