Skip to content

Instantly share code, notes, and snippets.

@uniquelau
Created July 14, 2011 10:21
Show Gist options
  • Save uniquelau/1082229 to your computer and use it in GitHub Desktop.
Save uniquelau/1082229 to your computer and use it in GitHub Desktop.
Navigation Main
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umb="urn:umbraco.library"
exclude-result-prefixes="msxml umb">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<!-- Navigation Main - Laurie, 14th July 2011 -->
<xsl:template match="/">
<xsl:variable name="filter" select="/macro/filter" />
<xsl:apply-templates select="$currentPage/ancestor-or-self::* [@isDoc and @level= 1]/* [@isDoc] [contains(layoutNavigation, $filter)]" />
</xsl:template>
<xsl:template match="* [@isDoc]">
<li>
<a href="{umb:NiceUrl(@id)}">
<xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id">
<xsl:attribute name="class">active</xsl:attribute>
</xsl:if>
<xsl:value-of select="@nodeName" />
</a>
</li>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment