Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Anthony Candaele 1197 posts 2049 karma points
    Dec 16, 2013 @ 11:08
    Anthony Candaele
    0

    listing multiple files with DAMP

    Hi,

    I need to enable multiple document links on a doctype. For uploading a document, I'm using the Digibiz Advanced Media Picker.

    Up until now, I only enabled selecting one document file with DAMP, but not I need te enable selecting multiple document files and listing those documents on a page.

    Does anyone know where I can find example code for iterating over multiple documents of type DAMP?

    Thanks for your help,

    Anthony

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Dec 16, 2013 @ 11:14
    Jeroen Breuer
    1

    Hello,

    Try the DAMP samples project: http://www.screenr.com/gz0s

    It shows how to iterative over multiple media items. It doesn't matter if it's an image or not because they all have the url (umbracoFile) property.

    The DAMP Gallery and Hybrid Framework show how to do this with newer techniques.

    Jeroen

  • Anthony Candaele 1197 posts 2049 karma points
    Dec 16, 2013 @ 13:32
    Anthony Candaele
    100

    Thanks Jeroen,

    Through some trial and error I got it working like this:

    @if (@Model.HasValue("activityDownload"))
    {
        <h3>Download</h3>
        var documents = @Model.activityDownload;
        <ul>
        @foreach (dynamic document in documents)
        {
          var file = document.ActivityDocument;
          var filename = Path.GetFileName(file.InnerText);
          <li><a href="@file.umbracoFile">@filename</a></li>
        }
        </ul>
    }
    

    The version of my Umbraco install is 4.9.0 and the DAMP version is 2.0, so I guess I'm not able to use the Hybrid Framework.

    greetings,

    Anthony

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Dec 16, 2013 @ 13:35
    Jeroen Breuer
    1

    The Hybrid Framework is more to begin new websites with. If you're using 4.9 with DAMP 2.0 your example is the best solution. 

    Jeroen

Please Sign in or register to post replies

Write your reply to:

Draft