Error loading Razor Script LibrariesGetPictureCarousel.cshtmlCannot
implicitly convert type 'umbraco.MacroEngines.DynamicNode' to
'System.Collections.IEnumerable'. An explicit conversion exists (are you
missing a cast?)
And if i try this :
@foreach (var img in Model.image){}
I can't find any parameter wich works like @img.Image or @img.Name etc ...
Problem to load image with MultipleMediaPicker in current page
Hello,
i got a problem to load image with MultipleMediaPicker in current page.
my umbraco config looks like :
<DAMP fullMedia=""> <mediaItem> <MultipleImage id="1135" version="6f8a3e4f-a557-4e6f-a7d9-216cead8e183" parentID="1122" level="3" writerID="0" nodeType="1134" template="0" sortOrder="1" createDate="2011-09-05T12:12:29" updateDate="2011-09-05T12:12:30" nodeName="Paysage" urlName="paysage" writerName="Admin" nodeTypeAlias="MultipleImage" path="-1,1121,1122,1135"> <image>/media/286/chrysanthemum.jpg</image> </MultipleImage> </mediaItem> <mediaItem> <MultipleImage id="1136" version="4ce88f35-e6a5-4750-b85c-da3e7d82c173" parentID="1122" level="3" writerID="0" nodeType="1134" template="0" sortOrder="2" createDate="2011-09-05T12:33:45" updateDate="2011-09-05T12:33:46" nodeName="image 2" urlName="image2" writerName="Admin" nodeTypeAlias="MultipleImage" path="-1,1121,1122,1136"> <image>/media/287/desert.jpg</image> </MultipleImage> </mediaItem> <mediaItem> <MultipleImage id="1137" version="14f428ea-d04e-4efe-bdb8-8f633a952db3" parentID="1122" level="3" writerID="0" nodeType="1134" template="0" sortOrder="3" createDate="2011-09-05T12:34:04" updateDate="2011-09-05T12:34:04" nodeName="image 3" urlName="image3" writerName="Admin" nodeTypeAlias="MultipleImage" path="-1,1121,1122,1137"> <image>/media/288/hydrangeas.jpg</image> </MultipleImage> </mediaItem> </DAMP>If i tried something like that :
I got this error :
Error loading Razor Script LibrariesGetPictureCarousel.cshtmlCannot implicitly convert type 'umbraco.MacroEngines.DynamicNode' to 'System.Collections.IEnumerable'. An explicit conversion exists (are you missing a cast?)And if i try this :
@foreach (var img in Model.image) {}I can't find any parameter wich works like @img.Image or @img.Name etc ...
Thank you in advance for your help
Your DAMP xml looks a bit strange. Are you using a custom media type which only has an image property?
What's the name of the property which has the media picker on your documenttype?
Something like this should work:
@foreach (dynamic d in Model.propertyName) { <li> <a href="@d.MultipleImage.image"> <img src="d.MultipleImage.image"/> </a> </li> }Jeroen
Yes this is a custom media, and it's work.
Thank you very much :)
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.