I don't know what could be wrong, but did you have a look at the DAMP gallery? There you can see how you can loop through multiple items: http://24days.in/umbraco/2012/damp-gallery/
Thanks, I download the DAMP gallery and I'm looking into it now, but I can't seem to find any demo-code where there is looped through multiple documents that where created with DAMP.
DAMP iterating multiple document files
Hi,
I'm extending uBlogsy with the ability to add downloadable documents to a blogpost:
I'm having difficulty however to loop through the multiple DAMP files in my Razor script file.
The Xml in my umbraco.config file looks like this:
<uBlogsyDownload>
<DAMP fullMedia="">
<mediaItem>
<NewsDocument id="1876" version="e6a09e58-0ed9-4718-b001-771b260a7296" parentID="1865" level="3" writerID="0" nodeType="1866" template="0" sortOrder="0" createDate="2013-01-13T11:00:36" updateDate="2013-01-13T11:00:36" nodeName="hazard-pictograms-leaflet" urlName="hazard-pictograms-leaflet" writerName="admin" nodeTypeAlias="NewsDocument" path="-1,1072,1865,1876">
<umbracoFile>/media/20977/hazard-pictograms-leaflet.pdf</umbracoFile>
<umbracoBytes>354121</umbracoBytes>
<umbracoExtension>pdf</umbracoExtension>
</NewsDocument>
</mediaItem>
<mediaItem>
<NewsDocument id="1877" version="1590568e-1446-47b1-852b-09444f5cf501" parentID="1865" level="3" writerID="0" nodeType="1866" template="0" sortOrder="0" createDate="2013-01-13T11:02:42" updateDate="2013-01-13T11:02:42" nodeName="hazardous-chemicals-pictogram-poster" urlName="hazardous-chemicals-pictogram-poster" writerName="admin" nodeTypeAlias="NewsDocument" path="-1,1072,1865,1877">
<umbracoFile>/media/20996/hazardous-chemicals-pictogram-poster.pdf</umbracoFile>
<umbracoBytes>3135025</umbracoBytes>
<umbracoExtension>pdf</umbracoExtension>
</NewsDocument>
</mediaItem>
</DAMP>
</uBlogsyDownload>
I tried to access all documents (NewsDocument) using the DAMP_Helper.GetFiles() method like this:
var documents = DAMP_Helper.GetFiles("uBlogsyDownload");
but this doesn't work.
Does anyone know how I can loop through the DAMP files.
Thanks a lot for your help,
Anthony
I'm seriously starting to think something must have gone wrong after upgrading from Umbraco 4.7.2 to 4.11.3.1
I couldn't loop through the uComponents Multiple-URL Picke values using this loop
"foreach (link in Model.uBlogsyPostLinks.urlpicker)"
And know it seems I can't access the multiple documents that where uploaded with Digibiz Advanced Media Picker:
"dynamic documents = Model.uBlogsyPostDownload.mediaItem.NewsDocument.File"
Could it be that an Umbraco upgrade somehow has screwed the Razor functionality on my website?
What I don't understand however is that the other Razor scripts are working.
Seriously thinking about rebuilding my website with a fresh Umbraco install, although this will cost me a couple of weeks work.
Thanks for your advice,
Anthony
I don't know what could be wrong, but did you have a look at the DAMP gallery? There you can see how you can loop through multiple items: http://24days.in/umbraco/2012/damp-gallery/
Jeroen
Hi Jeroen,
Thanks, I download the DAMP gallery and I'm looking into it now, but I can't seem to find any demo-code where there is looped through multiple documents that where created with DAMP.
There aren't any .cshtml files either.
greetings,
Anthony
oh now I see, there in the Views folder. Forgot this was an MVC application :)
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.