I am not sure how to implemt this into a XSLT file. I am trying to make a toggle on a mobile menu temlate,my current solution reloads the window when I have to see a subpage, I thought toggling on main page would solve that problem.
Here is a fiddle for example I would like to implement the same functionality. http://jsfiddle.net/p5726jxf/1/
and this is my XSLT code.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<!--
Description: ul/li based navigation. No features from admin implemented.
Recommended settings:
Fold out: True or False
Upper menu: Dynamic or Static
First level: > 0
Last level: >= First level
-->
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes" encoding="utf-8" />
<xsl:param name="html-content-type" />
<xsl:template match="/NavigationTree">
<xsl:if test="count(//Page) > 0">
<ul>
<xsl:apply-templates select="Page">
<xsl:with-param name="depth" select="1"/>
</xsl:apply-templates>
</ul>
</xsl:if>
</xsl:template>
<xsl:template match="//Page">
<xsl:param name="depth"/>
<li>
<xsl:attribute name="class">
<xsl:if test="@InPath='True'">inpath </xsl:if>
<xsl:if test="position() = 1">firstitem </xsl:if>
<xsl:if test="position() = count(//Page)">lastitem </xsl:if>
<xsl:if test="@Active='True'">activeitem </xsl:if>
<xsl:if test="count(//Page) > 0">parentitem </xsl:if>
</xsl:attribute>
<a>
<xsl:attribute name="href">
<xsl:value-of select="@FriendlyHref" disable-output-escaping="yes"/>
</xsl:attribute>
<xsl:value-of select="@MenuText" disable-output-escaping="yes"/>
<xsl:if test="@Active='True'">
<span class="fa fa-chevron-right pull-right"> </span>
</xsl:if>
</a>
<xsl:if test="count(Page)">
<ul class="M{@AbsoluteLevel}">
<xsl:apply-templates select="Page">
<xsl:with-param name="depth" select="$depth+1"/>
</xsl:apply-templates>
</ul>
</xsl:if>
</li>
</xsl:template>
</xsl:stylesheet>
I would really appreciate the help, I have spent long time on this but still can't get around it.
Best Regards
Aditya Bante