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
Hi there. I think I need some help with the new way of developing xslts.
I've got this sitemap in umbraco:
http://i55.tinypic.com/x0vjg9.jpg
But there's something wrong with my xslt, so it doesn't render the sitemap correctly.Kalender isn't a childnode to "Ren Artikel", but my xslt renders it that way.
Here's the code:
<nav> <h4> <xsl:value-of select="$startItem/menuTitle"/> </h4> <ul> <li> <xsl:choose> <xsl:when test="$currentPage/@id = $startItem/@id"> <xsl:attribute name="class">parent active current</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="class">parent active</xsl:attribute> </xsl:otherwise> </xsl:choose> <a> <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl($startItem/@id)"/> </xsl:attribute> <xsl:value-of select="$startItem/menuTitle"/> </a> <xsl:if test="count(child::*) > 0"> <ul> <xsl:for-each select="$startItem/*[@isDoc and name() !='IntranetFolder']"> <xsl:variable name="leftnav" select="current()/hideFromLeftMenu"/> <xsl:if test="($leftnav != '1' and name() !='IntranetFolder')"> <li> <xsl:choose> <xsl:when test="$currentPage/@id = current()/@id"> <xsl:attribute name="class">parent active current</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$currentPage/ancestor-or-self::*/@id = current()/@id"> <xsl:attribute name="class">parent active</xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="class">parent</xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> <a> <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl(current()/@id)"/> </xsl:attribute> <xsl:value-of select="current()/menuTitle"/> </a> <xsl:if test="count(child::*) > 0"> <ul> <xsl:for-each select="current()/*[@isDoc and name() !='IntranetFolder']"> <xsl:variable name="curleftnav" select="current()/hideFromLeftMenu"/> <xsl:if test="($curleftnav != '1' and name() !='IntranetFolder' )"> <li> <xsl:choose> <xsl:when test="$currentPage/ancestor-or-self::*/@id = current()/@id"> <xsl:attribute name="class">active current</xsl:attribute> </xsl:when> </xsl:choose> <a> <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl(current()/@id)"/> </xsl:attribute> <xsl:value-of select="current()/menuTitle"/> </a> </li> </xsl:if> </xsl:for-each> </ul> </xsl:if> </li> </xsl:if> </xsl:for-each> </ul> </xsl:if> </li> </ul> </nav>
Any ideas why Kalender is rendered as a childnode to "Ren Artikel" even when it's not inside Umbraco?
http://i53.tinypic.com/xqhyip.jpg
This is how it's rendered in the html :(
Ok, so I fixed it my self.
it was a problem with my count. the menu wrote empty <ul> elements.
You might want to consider using (named) templates that recursively call themselves. DRY!
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
problem with umbraco 4.5.x generating a submenu xslt
Hi there. I think I need some help with the new way of developing xslts.
I've got this sitemap in umbraco:
http://i55.tinypic.com/x0vjg9.jpg
But there's something wrong with my xslt, so it doesn't render the sitemap correctly.
Kalender isn't a childnode to "Ren Artikel", but my xslt renders it that way.
Here's the code:
<nav>
<h4>
<xsl:value-of select="$startItem/menuTitle"/>
</h4>
<ul>
<li>
<xsl:choose>
<xsl:when test="$currentPage/@id = $startItem/@id">
<xsl:attribute name="class">parent active current</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class">parent active</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<a>
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:NiceUrl($startItem/@id)"/>
</xsl:attribute>
<xsl:value-of select="$startItem/menuTitle"/>
</a>
<xsl:if test="count(child::*) > 0">
<ul>
<xsl:for-each select="$startItem/*[@isDoc and name() !='IntranetFolder']">
<xsl:variable name="leftnav" select="current()/hideFromLeftMenu"/>
<xsl:if test="($leftnav != '1' and name() !='IntranetFolder')">
<li>
<xsl:choose>
<xsl:when test="$currentPage/@id = current()/@id">
<xsl:attribute name="class">parent active current</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$currentPage/ancestor-or-self::*/@id = current()/@id">
<xsl:attribute name="class">parent active</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class">parent</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<a>
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:NiceUrl(current()/@id)"/>
</xsl:attribute>
<xsl:value-of select="current()/menuTitle"/>
</a>
<xsl:if test="count(child::*) > 0">
<ul>
<xsl:for-each select="current()/*[@isDoc and name() !='IntranetFolder']">
<xsl:variable name="curleftnav" select="current()/hideFromLeftMenu"/>
<xsl:if test="($curleftnav != '1' and name() !='IntranetFolder' )">
<li>
<xsl:choose>
<xsl:when test="$currentPage/ancestor-or-self::*/@id = current()/@id">
<xsl:attribute name="class">active current</xsl:attribute>
</xsl:when>
</xsl:choose>
<a>
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:NiceUrl(current()/@id)"/>
</xsl:attribute>
<xsl:value-of select="current()/menuTitle"/>
</a>
</li>
</xsl:if>
</xsl:for-each>
</ul>
</xsl:if>
</li>
</xsl:if>
</xsl:for-each>
</ul>
</xsl:if>
</li>
</ul>
</nav>
Any ideas why Kalender is rendered as a childnode to "Ren Artikel" even when it's not inside Umbraco?
http://i53.tinypic.com/xqhyip.jpg
This is how it's rendered in the html :(
Ok, so I fixed it my self.
it was a problem with my count. the menu wrote empty <ul> elements.
You might want to consider using (named) templates that recursively call themselves. DRY!
is working on a reply...