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
Not sure how to approach solving this (still wrapping my head around xslt) using the list whole structure from current page template. This works, however, i'd like it to output subpages in a nested list item
<?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" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets "> <xsl:output method="xml" omit-xml-declaration="yes" /> <xsl:param name="currentPage"/> <xsl:template match="/"> <!-- The fun starts here --> <ul> <xsl:for-each select="$currentPage/descendant::* [@isDoc and string(umbracoNaviHide) != '1']"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </ul> </xsl:template> </xsl:stylesheet>
oh yea and i'm using the new schema
Hi Carlo,
Try this for starters, and tweak it to your liking:
<?xml version="1.0" encoding="utf-8" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="umbraco.library" > <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" /> <xsl:param name="currentPage" /> <xsl:template match="/"> <h1><xsl:value-of select="$currentPage/@nodeName" /></h1> <ul> <xsl:apply-templates select="$currentPage/*[@isDoc][not(umbracoNaviHide = 1)]" /> </ul> </xsl:template> <!-- Template for generic Document Type --> <xsl:template match="*[@isDoc]"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName" /> </a> <xsl:if test="*[@isDoc][not(umbracoNaviHide = 1)]"> <ul> <xsl:apply-templates select="*[@isDoc]" /> </ul> </xsl:if> </li> </xsl:template> <!-- No output for these --> <xsl:template match="*[umbracoNaviHide = 1]" /> </xsl:stylesheet>
/Chriztian
Thanks chriztian that helped me a lot understand xslt.. however i ended up using this
<xsl:for-each select="$currentPage/PolicyCategory"> <tr> <th> <xsl:value-of select="@nodeName"/> </th> <th> </th> <th> </th> </tr> <xsl:if test="count(./PolicyDocument) > 0"> <xsl:for-each select="./PolicyDocument"> <tr> <td> </td> <td><a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a></td> <td><xsl:value-of select="policyCode"/></td> </tr> </xsl:for-each> </xsl:if></xsl:for-each>
ohk i ised this i just have another question i dont want any a href for the top level only for the sub levels how do i do it..
like
Category ( no hyperlink)
-child
-child (with hyperlinks)
any code sample would be useful
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
List all pages and sub pages from current node
Not sure how to approach solving this (still wrapping my head around xslt) using the list whole structure from current page template. This works, however, i'd like it to output subpages in a nested list item
oh yea and i'm using the new schema
Hi Carlo,
Try this for starters, and tweak it to your liking:
/Chriztian
Thanks chriztian that helped me a lot understand xslt.. however i ended up using this
ohk i ised this i just have another question i dont want any a href for the top level only for the sub levels how do i do it..
like
Category ( no hyperlink)
-child
-child (with hyperlinks)
any code sample would be useful
is working on a reply...