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.
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.
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"/>
}
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.
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!
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
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.
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>
}
}
}
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:
Jeroen
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.
is working on a reply...