This works but when I try var pics = Library.MediaById(Galleries.Weddings); I get an umbraco razor file not loaded when weddings is a folder in the galleries folder in the main media folder. It works but would be more better if I could just refernece them by name.
@{ var pics = Library.NodeById(1802);
foreach(var item in pics.Children) { <img src="@item.umbracoFile" />
Library.MediaById not working
If I use
var pics = Library.NodeById(1802);
This works but when I try var pics = Library.MediaById(Galleries.Weddings); I get an umbraco razor file not loaded when weddings is a folder in the galleries folder in the main media folder. It works but would be more better if I could just refernece them by name.
@{
var pics = Library.NodeById(1802);
foreach(var item in pics.Children)
{
<img src="@item.umbracoFile" />
}
}
I normally do something like this to ensure the node is a folder and then only get child nodes that are images:
@Rocoech
Try something like this. Not sure if it is what you want. but this is what we do.
is working on a reply...