Yes - what you're seeing is the text() value of the XML you get from the GetMedia() call (e.g. with <xsl:value-of />), which looks something like this:
To get the values from the XML in an efficient way, do something like this:
<xsl:template match="/">
<!-- Make sure an image was picked -->
<xsl:if test="normalize-space($currentPage/pickerAlias)">
<!-- Get the XML -->
<xsl:variable name="mediaNode" select="umbraco.library:GetMedia($currentPage/pickerAlias, false())" />
<!-- Process the Image -->
<xsl:apply-templates select="$mediaNode[not(error)]" />
</xsl:if>
</xsl:template>
<!-- Template for an Image -->
<xsl:template match="Image">
<img src="{umbracoFile}" width="{umbracoWidth}" height="{umbracoHeight}" />
</xsl:template>
<!-- Other templates... -->
<xsl:template match="File | Folder">
<!-- Do something -->
</xsl:template>
Just saw that you're using DAMP - if you're usin the "Store full media XML", then you can skip the GetMedia() call and set the mediaNode variable like this instead:
media picker adds numbers til file name
Using the generic media picker and standard getmedia to retrieve contents of a media folder the media picker adds this: 160608611png to the file name.
I'm on umb 4.11. DAMP is installed btw.
<img src="/media/6773/peterbyg.png160608611png"
Clues anyone?
Hi Claus,
Yes - what you're seeing is the text() value of the XML you get from the GetMedia() call (e.g. with <xsl:value-of />), which looks something like this:
To get the values from the XML in an efficient way, do something like this:
Hope that helps :-)
/Chriztian
Just saw that you're using DAMP - if you're usin the "Store full media XML", then you can skip the GetMedia() call and set the mediaNode variable like this instead:
/Chriztian
Actually I'm using the built-in 'old' media picker for this property with this xslt:
On the media type Image I noticed the [mediaLinks] property - what is that used for?
Duh! Feel dumb now!! The reason for the added numbers to the media was I used getMedia and not urlencode.
Everything is fine now with these lines.
is working on a reply...