i have a basic image carousel that is looping through images in a folder (within media) , however now that sub folders are added the carousel breaks and i think its bwecause the folders are seen as children of the folder and being treated as images (so cant resolve url)
how do i check for an image type (to stop folders being rendered)?
@foreach (var mediaItem in myMediaFolder.Children)
identifying media image type
i have a basic image carousel that is looping through images in a folder (within media) , however now that sub folders are added the carousel breaks and i think its bwecause the folders are seen as children of the folder and being treated as images (so cant resolve url)
how do i check for an image type (to stop folders being rendered)?
@foreach (var mediaItem in myMediaFolder.Children)
{
<li style="margin-right:10px;"><img src="@mediaItem.Url" alt="@mediaItem.Name" width="100" height="70"></li>
}
Hi Mark,
you can exlude the folders with an where-statement like this :
Or you can check the NodeTypeAlias with an if-statement in the foreach-loop.
Sören
@Soren, I think Mark needs that in reverse :-)
Either:
Or
Hi Jeavon,
of course, you're right :-)
thats great thanks
is working on a reply...