Posted By

fengelz on 09/23/11


Tagged

media umbraco razor damp


Versions (?)

Getting a DAMP mediaitem in umbraco with razor


 / Published in: C#
 

This snippet applies if the datatype is DAMP and data is stored as full xml.

  1. @if (Model.media.GetType() == typeof(umbraco.MacroEngines.DynamicXml))
  2. {
  3. //if mediatype is a file
  4. <a href="@Model.media.mediaItem.File.umbracoFile">file</a>
  5. //if mediatype is an image
  6. <img alt="pdf" height="70" src="@Model.media.mediaItem.Image.umbracoFile" />
  7. }

Report this snippet  

You need to login to post a comment.