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
Tryed to translat xslt 2. and 3. level menu to new schema, but with no luck.
It renders no nodes.
Here is my code so far:
<?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" exclude-result-prefixes="msxml umbraco.library"><xsl:output method="xml" omit-xml-declaration="yes" /><xsl:param name="currentPage"/><xsl:variable name="level" select="1"/><xsl:template match="/"> <xsl:call-template name="printListe"> <xsl:with-param name="node" select="$currentPage/ancestor-or-self::*[@isDoc and @level = 2]"/> <xsl:with-param name="id" select="string('leftMenu')"/> </xsl:call-template></xsl:template><xsl:template name="printListe"> <xsl:param name="node"/> <xsl:param name="id"/><div id="LeftMenu"> <ul class="sideMenu"><xsl:if test="$id != ''"><xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute></xsl:if><xsl:for-each select="$node/node [@nodeTypeAlias != 'DateFolder' and @nodeTypeAlias != 'LBKnewsItem']"><li> <xsl:if test="$currentPage/ancestor-or-self::*[@isDoc]/@id = current()/@id"> <xsl:attribute name="class">here</xsl:attribute> </xsl:if> <a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a> <xsl:if test="$currentPage/ancestor-or-self::*[@isDoc]/@id = current()/@id"> <xsl:if test="current()/@level = 3"> <xsl:if test="count(./node) > 0"> <xsl:call-template name="printListe"> <xsl:with-param name="node" select="."/> </xsl:call-template> </xsl:if> </xsl:if> </xsl:if></li></xsl:for-each></ul></div></xsl:template></xsl:stylesheet>
Any ideas?
Hi Fioffy,
I think you are very close to a solution that works. As I see it, it's just small changes as needed if I'm right. You might try something like.
<?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" exclude-result-prefixes="msxml umbraco.library"><xsl:outputmethod="xml"omit-xml-declaration="yes"/><xsl:paramname="currentPage"/><xsl:variablename="level"select="1"/><xsl:templatematch="/"> <xsl:call-templatename="printListe"> <xsl:with-paramname="node"select="$currentPage/ancestor-or-self::*[@isDoc and @level = 2]"/> <xsl:with-paramname="id"select="string('leftMenu')"/> </xsl:call-template></xsl:template><xsl:templatename="printListe"> <xsl:paramname="node"/> <xsl:paramname="id"/><divid="LeftMenu"> <ulclass="sideMenu"><xsl:iftest="$id != ''"><xsl:attributename="id"><xsl:value-ofselect="$id"/></xsl:attribute></xsl:if><xsl:for-eachselect="$node/*[@isDoc][name() != 'DateFolder' and name() != 'LBKnewsItem']"><li> <xsl:iftest="$currentPage/ancestor-or-self::*[@isDoc]/@id = current()/@id"> <xsl:attributename="class">here</xsl:attribute> </xsl:if> <ahref="{umbraco.library:NiceUrl(@id)}"><xsl:value-ofselect="@nodeName"/></a> <xsl:iftest="$currentPage/ancestor-or-self::*[@isDoc]/@id = current()/@id"> <xsl:iftest="current()/@level = 3"> <xsl:iftest="count(./*[@isDoc]) > 0"> <xsl:call-templatename="printListe"> <xsl:with-paramname="node"select="."/> </xsl:call-template> </xsl:if> </xsl:if> </xsl:if></li></xsl:for-each></ul></div></xsl:template></xsl:stylesheet>
Hope this can help you.
/Dennis
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Translate menu to new schema
Tryed to translat xslt 2. and 3. level menu to new schema, but with no luck.
It renders no nodes.
Here is my code so far:
Any ideas?
Hi Fioffy,
I think you are very close to a solution that works. As I see it, it's just small changes as needed if I'm right.
You might try something like.
Hope this can help you.
/Dennis
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.