I am fairly new to umbraco and XSLT, loving it so far. I have found most of my
solutions to problems on the forums which is brilliant.
Currently I am having a problem with a content picker and XSLT. I have had a
look around the forums and other people have had the same problems and I still
haven't been able to solve it. I am sure its something simple I am forgetting
to do.
I have a content picker on the page, you select a page and I want to show the content from that page.
I have pasted my XSLT below, the content picker is called “snippet1”, if I
pass GetXmlNodeById the id of the page it populates the data correctly (which
is commented out in the code below). If I try to use the picker version no data
is shown.
It looks like you are using the old XML schema and probably
therefore not getting any results for snippet1. If you are using
umbraco 4.5 and have not explicitly set it to use the old XML schema,
you should change:
XSLT ContentPicker Problems
Hi Guys
I am fairly new to umbraco and XSLT, loving it so far. I have found most of my solutions to problems on the forums which is brilliant.
Currently I am having a problem with a content picker and XSLT. I have had a look around the forums and other people have had the same problems and I still haven't been able to solve it. I am sure its something simple I am forgetting to do.
I have a content picker on the page, you select a page and I want to show the content from that page.
I have pasted my XSLT below, the content picker is called “snippet1”, if I pass GetXmlNodeById the id of the page it populates the data correctly (which is commented out in the code below). If I try to use the picker version no data is shown.
<xsl:param name="currentPage" />
<xsl:variable name="box1Node" select="umbraco.library:GetXmlNodeById($currentPage/data[@alias = 'snippet1'])"/>
<!--<xsl:variable name="box1Node" select="umbraco.library:GetXmlNodeById(1097)"/>-->
<xsl:template match="/">
<xsl:value-of select="$box1Node/pageTitle"/>
<xsl:value-of select="$box1Node/pageContent" disable-output-escaping="yes"/>
</xsl:template>
Any help or pointing me in the right direction would be great.
Cheers
Alistair
I have also tired,
<xsl:param name="currentPage" />
<xsl:variable name="box1Node" select="umbraco.library:GetXmlNodeById($currentPage/data[@alias = 'snippet1'])"/>
<xsl:template match="/">
<div class="ItRunsTheXSLTNoCodeFound">
<xsl:value-of select="$box1Node/data [@alias = 'pageTitle']"/>
<xsl:value-of select="$box1Node/data [@alias = 'pageContent']" disable-output-escaping="yes"/>
</div>
</xsl:template>
Still not had any luck.
Cheers
Alistair
Hi,
It looks like you are using the old XML schema and probably therefore not getting any results for snippet1. If you are using umbraco 4.5 and have not explicitly set it to use the old XML schema, you should change:
to:
More info here: http://our.umbraco.org/wiki/reference/xslt/45-xml-schema
Hi Tom
Thanks for your help and the link that has worked straight away,
Cheers
Alistair
is working on a reply...