Copied to clipboard

Flag this post as spam?

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


  • Dominic Kelly 114 posts 133 karma points
    May 05, 2012 @ 19:44
    Dominic Kelly
    0

    Attach multiple documents?

    In the right hand side of my page I want to add mulitple links to documents that have been uploaded to the Media library. I was to display the document title as the name, and the url should be a direct link to the file, internal or external.

    Could someone please provide the Razor code for this, plus let me know which data type to use - either first or third party.

    Much appreciated!

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    May 05, 2012 @ 23:44
    Jeroen Breuer
    0

    You can use DAMP to select multiple media files. It also has some Razor examples from the DAMP 2.0 Samples here: http://damp.codeplex.com/SourceControl/changeset/view/86116#1970702

    Jeroen

  • Dominic Kelly 114 posts 133 karma points
    May 06, 2012 @ 12:01
    Dominic Kelly
    0

    Thanks. I've been trying this for an hour. The documentation is weak, so I have no idea what I'm supposed to be doing.

    I've created the control and added some pdfs to it. I've added the sample code to my template and no data is outputed.

  • Dominic Kelly 114 posts 133 karma points
    May 06, 2012 @ 15:15
    Dominic Kelly
    0

    I'm haemoraging a ridiculous amount of time trying to work this out. I've copied and pasted about 50 example code snippets and none of them works. I'm utterely confounded at how such a simple CMS feature is made so ludicrously difficult by lack of documentation and working examples.

    This is my data type:

    http://screencast.com/t/I2PZ8IxGWL

    This is my document type:

    http://screencast.com/t/B8D91wE7X

    This is an example population:

    http://screencast.com/t/PZjvLLmn7

    I have managed to output the count of '2' in the front end template, but getting any further data out is impossible for me.

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @using DigibizAdvancedMediaPicker;

    <h3>Digibiz Advanced Media Picker</h3>
    @{
        if (Model.HasValue("media"){
            dynamic mediaItems Model.media.mediaItem;
            <p>@mediaItems.Count()</p>
                                      
                                      
                                      
                                      foreach (var item in mediaItems)
                                      {
                                      var image item;
                                    <p@image</p>
                                      
                                      }
      
      
      
        }
    }

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    May 06, 2012 @ 18:24
    Jeroen Breuer
    0

    I'm the creator of DAMP so I'll try to help as much as I can. Could you please post a piece of the DAMP xml here? It's in /App_Data/umbraco.config and the search for an element which has fullMedia="" as an attribute. If you could copy that here I might be able to see what goes wrong.

    For now you could try this:

    @foreach (dynamic m in Model.media)
    {
        var url = m.File.umbracoFile;
        <img src="@url" alt="@m.File.nodeName"/>
    }

    Jeroen

  • Dominic Kelly 114 posts 133 karma points
    May 06, 2012 @ 18:43
    Dominic Kelly
    0

    Thank you so much. The code you supplied worked first time. I'm not sure what I was doing wrong, but I'm very greatful. Nice module, too, much better than the native Umbraco picker. Thanks again for taking the time to help, I was pretty helpless there.

Please Sign in or register to post replies

Write your reply to:

Draft