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...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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...