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
Hello
Here is my sitemap script, it works fine:
<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" exclude-result-prefixes="msxml umbraco.library"> <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:param name="currentPage"/> <!-- update this variable on how deep your navigation should be --> <xsl:variable name="maxLevel" select="18"/> <xsl:template match="/"> <div id="sitemap"> <ul> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::* [@level=1 and @isDoc]"/> </xsl:call-template> </ul> </div> </xsl:template> <xsl:template name="drawNodes"> <xsl:param name="parent"/> <xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1 or umbraco.library:IsLoggedOn() = 1)"> <xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1' and @level <= $maxLevel]"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="siteName"/> </a> <xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1' and @level <= $maxLevel]) > 0"> <ul> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="."/> </xsl:call-template> </ul> </xsl:if> </li> </xsl:for-each> </xsl:if> </xsl:template> </xsl:stylesheet>
What I want to do is modify it so that it will only show the currents pages children.
Example tree looks like this:
Home - Services - Nail Clipping - Nail Polish - Nail Cleaning - Feet Cleaning - About
So if I am under Services it will output:
Please help me modify the script above to only show the children of the current page, I have tried so many thinks but I cannot figure out how to achieve this.
Hi Joachim,
Looking at the code, I'd guess that if you just send in $currentPage as the $parent, it should work as expected:
$currentPage
$parent
<xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="$currentPage" /> </xsl:call-template>
Have you tried that?
/Chriztian
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
modifying sitemap script - problems
Hello
Here is my sitemap script, it works fine:
What I want to do is modify it so that it will only show the currents pages children.
Example tree looks like this:
So if I am under Services it will output:
Please help me modify the script above to only show the children of the current page, I have tried so many thinks but I cannot figure out how to achieve this.
Hi Joachim,
Looking at the code, I'd guess that if you just send in
$currentPage
as the$parent
, it should work as expected:Have you tried that?
/Chriztian
is working on a reply...