Marko
Marko

Reputation: 10992

Finding the xml source for Media items in Umbraco?

I want to make some xslt or .net macros, but I don't really know how the xml-source. Isn't there a way to retrieve the source or is it hidden?

Upvotes: 0

Views: 523

Answers (1)

sebastiaan
sebastiaan

Reputation: 5917

I would recommend posting your questions on http://our.umbraco.org instead of on Stack Overflow as there are way more people who know the answer hanging out there than there are on Stack Overflow.

The XML source for all of your content is available from the /App_Data/umbraco.config file.

The XML source for media items is indeed hidden. You could try to use:

<xsl:copy-of select="umbraco.library:GetMedia($currentPage/image, 0)" /> 

.. where "image" is the alias of the media picker property.

The default media item's XML should look a bit like this:

      <Image id="1080" version="95613824-93a7-42ea-b2dd-284d247e9c40" parentID="1079" level="2" writerID="0" nodeType="1032" template="0" sortOrder="1" createDate="2011-05-11T10:40:12" updateDate="2011-05-11T10:40:12" nodeName="Default" urlName="default" writerName="admin" nodeTypeAlias="Image" path="-1,1079,1080">
        <umbracoFile>/media/491/img1.jpg</umbracoFile>
        <umbracoWidth>2580</umbracoWidth>
        <umbracoHeight>436</umbracoHeight>
        <umbracoBytes>169477</umbracoBytes>
        <umbracoExtension>jpg</umbracoExtension>
      </Image>

Upvotes: 3

Related Questions