Hello - I've got a problem with content picker and I'm sure I have made mistakes in the xslt.
I have created an xslt file in order to render the content (nodeName and summary) of a selected source. In order to display this information on other templates in my website. The xslt I've created seems to only display a selected source's children (nodeName and summary) - rather than it's own.
Could someone let me know the changes I need to make. Here's my code:
Help rendering content using content picker
Hello - I've got a problem with content picker and I'm sure I have made mistakes in the xslt.
I have created an xslt file in order to render the content (nodeName and summary) of a selected source. In order to display this information on other templates in my website. The xslt I've created seems to only display a selected source's children (nodeName and summary) - rather than it's own.
Could someone let me know the changes I need to make. Here's my code:
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:variable name="source" select="/macro/source"/>
<xsl:variable name="maxItems" select="/macro/maxItems"/>
<xsl:template match="/">
<ul>
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(umbracoNaviHide) != '1']">
<xsl:sort select="@createDate" order="ascending" />
<xsl:if test="position() <= $maxItems">
<li>
<h2><a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a></h2>
<p>
<xsl:value-of select="summary"/>
</p>
</li>
</xsl:if>
</xsl:for-each>
</ul>
</xsl:template>
Thank you!
Hi. To display both the node and its children you can use the "descendant-or-self::" like this:
Perfect - thank you.
is working on a reply...