I have the following structure in my Content and somehow I cant get my XSLT to populate the nodes as i want it to. Am actually using a Changeable Source XSLT with the following codes:
<ul> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::* [@isDoc and @level = 2 and string(umbracoNaviHide) != '1']"/> </xsl:call-template> </ul> </xsl:template> <xsl:template name="drawNodes"> <xsl:param name="parent"/> <xsl:if test="$parent/@level"> <!--<ul>--> <xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1']"> <li> <xsl:attribute name="class"> <xsl:choose> <xsl:when test="$parent/ancestor-or-self::* [@level = 3] "> <xsl:text>left-menu-link</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text></xsl:text> </xsl:otherwise> </xsl:choose> <xsl:if test="$currentPage/@id = current()/@id"> <xsl:text> active</xsl:text> </xsl:if> </xsl:attribute> <a> <xsl:attribute name="href"> <xsl:value-of select="umbraco.library:NiceUrl(@id)"/></xsl:attribute> <xsl:value-of select="@nodeName"/> </a> </li> <!-- check if this is the current page AND if this has a child - if so run through again --> <xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1']) > 0 and $currentPage/ancestor-or-self::*[@isDoc and @level]"> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="."/> </xsl:call-template> </xsl:if> <!--</li>--> </xsl:for-each> <!--</ul>--> </xsl:if> </xsl:template>
Here is how my Content Looks like and what am trying to do is to get the Nodes of SubContainer 1 to display.
Is it displaying Subcontainer 1 and 2 but just not showing their sublinks when one is active?
One thing I noticed is the line where you check for subpages and if the current node is the current page
<!-- check if this is the current page AND if this has a child - if so run through again --> <xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1']) > 0 and $currentPage/ancestor-or-self::*[@isDoc and @level]">
I think it should be like below, to check if this page or it's parents ID match the current ID in the loop.
<xsl:if test="count(./* [@isDoc and string(umbracoNaviHide) != '1']) > 0 and $currentPage/ancestor-or-self::*[@isDoc]/@id = ./@id">
What i want to achieve is only to show the nodes from SubContainer 1. The weird part of it is i got it working with one of my InnerTemplate but not the MasterHome Template.
It must be because of the level am using....dont you think?
Accessing a Drop Down Menu
Hello Guys,
I have the following structure in my Content and somehow I cant get my XSLT to populate the nodes as i want it to. Am actually using a Changeable Source XSLT with the following codes:
Here is how my Content Looks like and what am trying to do is to get the Nodes of SubContainer 1 to display.
* Content
** Default
** Right Container (folder)
// Sub Link 1
// Sub Link 2
** Left Container (Folder)
*** SubContainer 1
// Sub Link 1
// Sub Link 2
/// Sub Sub Link 2
/// Sub Sub Link 2
// Sub Link 3
*** SubContainer 2
// Sub Link 1
// Sub Link 2
// Sub Link 3
Can someone advise please??
//Fuji
Hi Fuji,
Is it displaying Subcontainer 1 and 2 but just not showing their sublinks when one is active?
One thing I noticed is the line where you check for subpages and if the current node is the current page
I think it should be like below, to check if this page or it's parents ID match the current ID in the loop.
-Tom
Hi Tom,
What i want to achieve is only to show the nodes from SubContainer 1. The weird part of it is i got it working with one of my InnerTemplate but not the MasterHome Template.
It must be because of the level am using....dont you think?
//fuji
Tom I changed the Structure of my Content but still i cant get the Child Nodes. Like this
*** SubContainer 1
// Sub Link 1
// Sub Link 2
/// Sub Sub Link 2
/// Sub Sub Link 2
// Sub Link 3
Hey Fuji, sorry for the delay, did you get this figured out in your other threads?
-Tom
Hi Tom, I changed the XSLT instead but thanks again for the support.
//fuji
is working on a reply...