So I am trying to create a photo Gallery by getting all the images in a folder from the media section. Using Umbraco 4.7.0 I used to be able to do this in Razor.
I Upgraded to 4.7.1.1 and now I get the error 'umbraco.MacroEngines.DynamicMedia' does not contain a definition for 'Children' and no extension method 'Children' accepting a first argument of type 'umbraco.MacroEngines.DynamicMedia' could be found (are you missing a using directive or an assembly reference?)
Did some googling and found ChildrenAsList, but I can't seem to get it to cast I get the message Cannot implicitly convert type 'System.Collections.Generic.List' to 'System.Collections.Generic.List'
Getting a List of Children from a Dynamic Media Node
Hey, I posted this over at stackoverflow, but no response there.
http://stackoverflow.com/questions/9318664/getting-a-list-of-children-from-a-dynamic-media-node
So I am trying to create a photo Gallery by getting all the images in a folder from the media section. Using Umbraco 4.7.0 I used to be able to do this in Razor.
I Upgraded to 4.7.1.1 and now I get the error 'umbraco.MacroEngines.DynamicMedia' does not contain a definition for 'Children' and no extension method 'Children' accepting a first argument of type 'umbraco.MacroEngines.DynamicMedia' could be found (are you missing a using directive or an assembly reference?)
Did some googling and found ChildrenAsList, but I can't seem to get it to cast I get the message Cannot implicitly convert type 'System.Collections.Generic.List' to 'System.Collections.Generic.List'
Any ideas on how to get this to work?
Sure, use the Library.MediaById() method. If the id of the galleryImage folder is 1234, then:
...should get you what you want.
Here is a link to a wiki entry which has some fun stuff on it for the media.
http://our.umbraco.org/wiki/reference/code-snippets/razor-snippets/simple-media-browser/media-folder-content-list
is working on a reply...