From Wikibooks, open books for an open world
Jump to navigation Jump to search


The method is used to get information of files in the media library - such as filename, size, height, width.


GetMedia(int MediaId, bool Deep);

  Integer   MediaId  
  Boolean   Deep 

Return value

The method returns a XPathNodeIterator with the information of selected file.


<xsl:value-of select="umbraco.library:GetMedia(./data [@alias = '< your property>'], 'false')"/>

Getting the url of a media file

  <xsl:value-of select="umbraco.library:GetMedia(1057, 'false')/data [@alias = 'umbracoFile']"/>

Getting the url of a media file with the new xml structure

  <xsl:value-of select="umbraco.library:GetMedia(1057, 'false')/umbracoFile"/>