i tried to use string(data[@alias='billede']) but that doesent change anything. I doublechecked spelling of property names and also checked that a picture is actually selected with the media picker, but still no go.
I have a feeleing that i'm overlooking some stupid mistake.
What is the result from <xsl:value-of select="data[@alias='billede']" />
It seems like it doesn't contain what you're expecting. So what does it contain? Is it just a number (the media id), or more than that? Or is it empty?
A combination of your code and a refresh of the cash solved the problem.
It's still a bit strange, i tried to change the datatype of the property to a contentpicker, expecting to se just a node id, but that didn't work either.
Problem wit inserting image
I have an xslt fiel with the following XSLT inspired from a recent thread.
Somehow it dosent insert the picture as i expect.
I have boiled it down to the choose statement. I doesent seem to get the property from the page (Property named billede, is a mediapicker)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:umbsql="urn:umbsql" xmlns:myExt="urn:myExt"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbsql myExt ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- start writing XSLT -->
<xsl:variable name="picID">
<xsl:choose>
<xsl:when test="data[@alias='billede'] != ''"><xsl:value-of select="data[@alias='billede']" /></xsl:when>
<xsl:otherwise>2138</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="$picID != '' ">
<img>
<xsl:attribute name="src">
<xsl:value-of select="umbraco.library:GetMedia($picID, false)/data [@alias = 'umbracoFile']" />
</xsl:attribute>
</img>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
i tried to use string(data[@alias='billede']) but that doesent change anything. I doublechecked spelling of property names and also checked that a picture is actually selected with the media picker, but still no go.
I have a feeleing that i'm overlooking some stupid mistake.
Mikael
What is the result from <xsl:value-of select="data[@alias='billede']" />
It seems like it doesn't contain what you're expecting. So what does it contain? Is it just a number (the media id), or more than that? Or is it empty?
cheers,
doug.
Hi Dough.
It's empty
Hmm
It probably has nothing to do with most of the above XSLT.
This:
<xsl:value-of select="string(data[@alias='billede'])" />
doesent even work alone, so somehow the mediapicker property is empty.
Try:
<xsl:value-of select="$currentPage/data[@alias='billede']" />
Thanks Peter
A combination of your code and a refresh of the cash solved the problem.
It's still a bit strange, i tried to change the datatype of the property to a contentpicker, expecting to se just a node id, but that didn't work either.
anyways now it works
You guys rock :-)
Mikael
is working on a reply...