Created
May 10, 2012 14:40
-
-
Save xpathr/2653488 to your computer and use it in GitHub Desktop.
Alternative Navigation by rainerborene
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet version="1.0" | |
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
| xmlns:exsl="http://exslt.org/common" | |
| extension-element-prefixes="exsl"> | |
| <xsl:variable name="menu"> | |
| <item handle="home">Home</item> | |
| <item handle="about">About</item> | |
| <item handle="contact">Contact</item> | |
| </xsl:variable> | |
| <xsl:template name="navigation"> | |
| <ul class="grid_3 alpha nav"> | |
| <xsl:for-each select="exsl:node-set($menu)/*"> | |
| <li> | |
| <a href="{$root}/{@handle}/"> | |
| <xsl:if test="$current-page = @handle"> | |
| <xsl:attribute name="class">selected</xsl:attribute> | |
| </xsl:if> | |
| <xsl:value-of select="text()"/> | |
| </a> | |
| </li> | |
| </xsl:for-each> | |
| </ul> | |
| </xsl:template> | |
| </xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment