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
Hi all,
Having spent the last 2 days trying to get this really simple 2 tier nav to work, you chaps are my last hope. Please help!
ALL I WANT TO DO is have a main site nav, which permanently displays the top nav items, then a nested list of the pages within them:
<?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="pages" select="umbraco.library:GetXmlAll()"/><xsl:param name="mainsite" select="$pages/node"/><xsl:template match="/"> <xsl:for-each select="$mainsite/node"> <xsl:if test="@parentID='1079'"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> <xsl:if test="contains(node , 0)"> <ul> <xsl:for-each select="node"> <li> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </ul> </xsl:if> </li> </xsl:if></xsl:for-each><!-- start writing XSLT --></xsl:template></xsl:stylesheet>
This nav works fine UNTIL the user drills down into the second level pages, at which point, the second level of the nav disappears!
If anybody can please give me a clue why my XSLT isn't working, I would be hugely grateful!
Please Disregard this - probelm solved: Javascript problem.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Really Basic Navigation stuff - a two tier main site nav
Hi all,
Having spent the last 2 days trying to get this really simple 2 tier nav to work, you chaps are my last hope. Please help!
ALL I WANT TO DO is have a main site nav, which permanently displays the top nav items, then a nested list of the pages within them:
<?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="pages" select="umbraco.library:GetXmlAll()"/>
<xsl:param name="mainsite" select="$pages/node"/>
<xsl:template match="/">
<xsl:for-each select="$mainsite/node">
<xsl:if test="@parentID='1079'">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
<xsl:if test="contains(node , 0)">
<ul>
<xsl:for-each select="node">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</li>
</xsl:if>
</xsl:for-each>
<!-- start writing XSLT -->
</xsl:template>
</xsl:stylesheet>
This nav works fine UNTIL the user drills down into the second level pages, at which point, the second level of the nav disappears!
If anybody can please give me a clue why my XSLT isn't working, I would be hugely grateful!
Please Disregard this - probelm solved: Javascript problem.
is working on a reply...