Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Am stuggling with this Xslt and cant figure a way out.
Here is the situation and am trying to display only Child Nodes instead of Parent node by using GetXmlNodeById
Folder Content (id= 1755 ) Folder News 1 News Item 1 News Item 2 Folder News 2 News Item 1 News Item 2 Folder News 3 News Item 1 News Item 2
I only want to display the Child nodes of Folder News 1, Folder News 2 and Folder News 3.
<xsl:for-each select="umbraco.library:GetXmlNodeById($level)//* [@isDoc]"> <xsl:sort select="@createDate" order="descending" /> <li> <xsl:value-of select="@nodeName"/> </li> <li> <xsl:call-template name="ImageGallery"/> </li> </xsl:for-each>
Instead am getting both the Folder and item Name. Any help on this please?
xpath:
"/" Selects children from the root node"//" Selects descendants from the root node
So without any knowledge about xslt, i think you could do : umbraco.library:GetXmlNodeById($level)/*[@isDoc]
also, you might wanna check these examples : http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/xslt-examples-updated-to-new-schema
wait... did you only want to show the items or the folders ? if items - it would be umbraco.library:GetXmlNodeById($level)/*[@isDoc]/*[@isDoc]
*could/should be replaces by document types...
i think... again not an xslt guy, but that xpath should match.
Hi Steffen,
I got this working what i did is
<xsl:for-each select="umbraco.library:GetXmlNodeById($level)//* [@isDoc][not(umbracoNaviHide = 1)]"> <xsl:sort select="@createDate" order="descending" /> <xsl:call-template name="linkItems"/> <a href="{umbraco.library:NiceUrl(@id)}"><xsl:call-template name="ImageGallery"/> </a> </xsl:for-each> </xsl:template> <!-- Template for the image --> <xsl:template name="ImageGallery"> <xsl:variable name="mediapickerproperty" select="./galleryPicker"/> <xsl:variable name="numMedia" select="4"/> <xsl:if test="$mediapickerproperty > 0"> <xsl:for-each select="umbraco.library:GetMedia($mediapickerproperty, 1)/PhotoGallery[1]"> <xsl:if test="position() <= $numMedia" > <img src="{umbraco.library:Replace(umbraco.library:GetMedia(@id, 0)/umbracoFile, '.', '_Thumbnail.')}"/> </xsl:if> </xsl:for-each> </xsl:if> </xsl:template> <!-- Display only Nodes with Document Type "Album" --> <xsl:template name=" linkItems "> <xsl:if test="self::Album"> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </xsl:if> </xsl:template>
So from my current page i get all the attributes from the Child Nodes then i just make a sorting to get the most current @createDate which will go through all Parents nodes checking for new documents created
//fuji
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Display Only Child Nodes
Am stuggling with this Xslt and cant figure a way out.
Here is the situation and am trying to display only Child Nodes instead of Parent node by using GetXmlNodeById
Folder Content (id= 1755 )
Folder News 1
News Item 1
News Item 2
Folder News 2
News Item 1
News Item 2
Folder News 3
News Item 1
News Item 2
I only want to display the Child nodes of Folder News 1, Folder News 2 and Folder News 3.
Instead am getting both the Folder and item Name. Any help on this please?
xpath:
"/" Selects children from the root node
"//" Selects descendants from the root node
So without any knowledge about xslt, i think you could do : umbraco.library:GetXmlNodeById($level)/*[@isDoc]
also, you might wanna check these examples : http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/xslt-examples-updated-to-new-schema
wait... did you only want to show the items or the folders ? if items - it would be umbraco.library:GetXmlNodeById($level)/*[@isDoc]/*[@isDoc]
*could/should be replaces by document types...
i think... again not an xslt guy, but that xpath should match.
Hi Steffen,
I got this working what i did is
So from my current page i get all the attributes from the Child Nodes then i just make a sorting to get the most current @createDate which will go through all Parents nodes checking for new documents created
//fuji
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.