I have utilized the following code inside of a partial view, but the issue I am running into is @media.umbracoFile is outputting extra info such as the focalPoint, whereas I just want the src.
@{
DynamicMedia folder = new DynamicMedia(1128);
if (folder != null && folder.Children.Items.Count() > 0)
{
foreach (dynamic media in folder.Children.Items)
{
<div class="three" style="text-align:center;">
<img src="@media.umbracoFile" alt="@media.Name" style="width:100%; max-width:229px; max-height:116px; text-align:center;" />
</div>
}
}
}
Display Media Folder Images in Partial View
I have utilized the following code inside of a partial view, but the issue I am running into is @media.umbracoFile is outputting extra info such as the focalPoint, whereas I just want the src.
Hi Renee.
Here is a working example based on your code, but with strongly typed media items as IPublishedContent, that way you dont have to work with dynamics.
Hope it helps!
Take care!
Brilliant! Thank you so much.
Thank you Renee!! Take care, have a great day!
is working on a reply...