I'm trying to create a modified version of Composite.Navigation.Quickmap that will highlight the selected area by applying a class attribute to the current <li> tag.
My Template is:
My Template is:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:in="http://www.composite.net/ns/transformation/input/1.0" xmlns:lang="http://www.composite.net/ns/localization/1.0" xmlns:f="http://www.composite.net/ns/function/1.0" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xsl in lang f">
<xsl:param name="toplinks" select="/in:inputs/in:result[@name='GetTopLinkXml']/TopLink" />
<xsl:param name="sublinks" select="/in:inputs/in:result[@name='GetSubLinkXml']/SubLink" />
<xsl:param name="pageId" select="/in:inputs/in:result[@name='GetPageId']" />
<xsl:template match="/">
<html>
<head></head>
<body>
<xsl:if test="$toplinks">
<ul class="navigation">
<li><xsl:value-of select="$pageId"/></li>
<xsl:for-each select="$toplinks">
<li>
<xsl:if test="$pageId=@Page">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="." />
<xsl:if test="$sublinks[@TopLink.Id=current()/@Id]">
<ul class="hidden">
<xsl:for-each select="$sublinks[@TopLink.Id=current()/@Id]">
<li>
<xsl:if test="$pageId=@Page">
<xsl:attribute name="class">selected</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="." />
</li>
</xsl:for-each>
</ul>
</xsl:if>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</body>
</html>
</xsl:template>
<xsl:template match="TopLink | SubLink">
<a href="~/Renderers/Page.aspx?pageId={@Page}">
<xsl:choose>
<xsl:when test="@Page.MenuTitle!=''">
<xsl:value-of select="@Page.MenuTitle" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@Page.Title" />
</xsl:otherwise>
</xsl:choose>
</a>
</xsl:template>
</xsl:stylesheet>
The Function Calls are:<functions>
<f:function xmlns:f="http://www.composite.net/ns/function/1.0" name="Composite.Navigation.Quickmap.SubLink.GetSubLinkXml" localname="GetSubLinkXml">
<f:param name="OrderByField" value="Position" />
<f:param name="PropertyNames">
<f:paramelement value="Page.Title" />
<f:paramelement value="TopLink.Id" />
<f:paramelement value="Position" />
<f:paramelement value="Id" />
<f:paramelement value="Page" />
<f:paramelement value="Page.MenuTitle" />
</f:param>
</f:function>
<f:function xmlns:f="http://www.composite.net/ns/function/1.0" name="Composite.Pages.GetPageId" localname="GetPageId" />
<f:function xmlns:f="http://www.composite.net/ns/function/1.0" name="Composite.Navigation.Quickmap.TopLink.GetTopLinkXml" localname="GetTopLinkXml">
<f:param name="PropertyNames">
<f:paramelement value="Page.Title" />
<f:paramelement value="Position" />
<f:paramelement value="Id" />
<f:paramelement value="Page" />
<f:paramelement value="Page.MenuTitle" />
</f:param>
<f:param name="OrderByField" value="Position" />
</f:function>
</functions>
Unfortunately, the GetPageId value isn't updating when I move from one page to another. How do I make this update immediately upon page load? I don't remember this being a problem in v3.2.