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 I have the folling macro
<xsl:template match="/"><ul class="nav">
<xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/child::* [@isDoc and string(umbracoNaviHide) != '1']">
<li><xsl:if test="count(./node) > 0"><xsl:attribute name="class">dropdown</xsl:attribute></xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a></li></xsl:for-each></ul>
</xsl:template>
This issue i have is that for some reason the count for the child nodes always comes back as 0
i am using the latest umbraco
thanks!
Hi Cookie Monster (!)
The check on "node" comes from the old "legacy" XML Schema - you can just check for any childnode instead:
<xsl:template match="/"> <ul class="nav"> <xsl:for-each select="$currentPage/ancestor-or-self::*[@isDoc and @level = $level]/*[@isDoc and not(umbracoNaviHide = 1)]"> <li> <xsl:if test="*[@isDoc]"> <xsl:attribute name="class">dropdown</xsl:attribute> </xsl:if> <a href="{umbraco.library:NiceUrl(@id)}"> <xsl:value-of select="@nodeName"/> </a> </li> </xsl:for-each> </ul> </xsl:template>
But you may want to include the umbracoNaviHide check in there too..?
/Chriztian
Hi Chriztian
Thanks for the help, that worked!
When did umbraco undergo the last schema change ? is the latest schema different from 4.7 ?
Hi again,
As of version 4.5 there was a new Schema: http://our.umbraco.org/wiki/reference/xslt/45-xml-schema
No - no schema changes for the last couple of years, actually :-)
But you could easily have been handed an older site, or work on a new version that was set to use the old schema.
If you have *any* say in this, make sure to use the new one - it's far superior and easier to work with :-)
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
Node Children empty
Hi I have the folling macro
<xsl:template match="/">
<ul class="nav">
<xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/child::* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<xsl:if test="count(./node) > 0">
<xsl:attribute name="class">dropdown</xsl:attribute>
</xsl:if>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
This issue i have is that for some reason the count for the child nodes always comes back as 0
i am using the latest umbraco
thanks!
Hi Cookie Monster (!)
The check on "node" comes from the old "legacy" XML Schema - you can just check for any childnode instead:
But you may want to include the umbracoNaviHide check in there too..?
/Chriztian
Hi Chriztian
Thanks for the help, that worked!
When did umbraco undergo the last schema change ? is the latest schema different from 4.7 ?
Hi again,
As of version 4.5 there was a new Schema: http://our.umbraco.org/wiki/reference/xslt/45-xml-schema
No - no schema changes for the last couple of years, actually :-)
But you could easily have been handed an older site, or work on a new version that was set to use the old schema.
If you have *any* say in this, make sure to use the new one - it's far superior and easier to work with :-)
/Chriztian
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.