If you select a media item only that media item is stored in the umbraco.config xml (so recursive is false). If you want to get the content of a media folder you could just select a folder in DAMP and use GetMedia on that folder. In the prevalues you can choose to only store the id so that's what I would do. Only store the id of the folder and get the content of that folder with GetMedia.
I was not able to display contents of the folder with GetMedia, it returned nothing. Can you please provide Razor sample to display contents of the folder?
You don't need to use GetMedia anymore if you store the media as full xml. Here is a simple Razor sample:
<ul class="photoalbum">
@*Loop through all the selected photo album images from DAMP.*@
@foreach (dynamic d in Model.photos)
{
<li>
<a href="@d.Image.umbracoFile" rel="gallery">
<img src="@d.Image.umbracoFile" width="190" height="190" align="left" border="0" class="styled" />
</a>
</li>
}
</ul>
Looping through the content of a folder ?
Is it possible the get the content of a media folder like with GetMedia(folderid, 1) ?
Hello Sebastiaan,
If you select a media item only that media item is stored in the umbraco.config xml (so recursive is false). If you want to get the content of a media folder you could just select a folder in DAMP and use GetMedia on that folder. In the prevalues you can choose to only store the id so that's what I would do. Only store the id of the folder and get the content of that folder with GetMedia.
Jeroen
Hi,
I was not able to display contents of the folder with GetMedia, it returned nothing. Can you please provide Razor sample to display contents of the folder?
Dorothy
You don't need to use GetMedia anymore if you store the media as full xml. Here is a simple Razor sample:
Jeroen
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.