Hi all am having some issues with displaying nodes from a Changeable XSLT.
I just changed my content tree to
* Content
** Default
** Folder 1
// Sub Link 1
// Sub Link 2
** Folder 2
// Sub Link 1
// Sub Link 2
/// Sub Sub Link 2
/// Sub Sub Link 2
// Sub Link 3
/// Sub Sub Link 2
/// Sub Sub Link 3
This is the code am using in my XSLT but i can get the nodes to display
<xsl:variable name="maxLevel" select="3" /> <xsl:template match="/"> <ul> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="$currentPage/descendant-or-self::* [@isDoc and @level and string(umbracoNaviHide) != '1']"/> </xsl:call-template> </ul> </xsl:template> <xsl:template name="drawNodes"> <xsl:param name="parent"/> <xsl:if test="$parent/@level < $maxLevel"> <!--<ul>--> <xsl:for-each select="$parent/* [@isDoc and string(umbracoNaviHide) != '1']"> <li> <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::*/@id = current()/@id"> <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>
Can you help me with that?? Am not getting the same output when am on other pages...can you tell me how to i display all the nodes of a parent and nodes of its child?
Basically I want to display all the nodes from Folder 2, but right now when am using this piece of code to draw all the nodes it giving me the nodes of from the currentPage am on and using a changeable XSLT
That's exactly what 'List Sub Pages by Changeable source does"
<!--Change this <xsl:variable name="source" select="/macro/source"/> -->
<!--Change this to use node id-->
<xsl:variable name="source" select="1020"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</li>
</xsl:for-each>
</ul>
<!-- The fun starts here --> <ul> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and @level=2 and string(umbracoNaviHide) != '1']"/> </xsl:call-template> </ul> </xsl:template>
<!-- The fun starts here --> <ul> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and @level=2 and string(umbracoNaviHide) != '1']"/> </xsl:call-template> </ul> </xsl:template>
Viewing Child Nodes
Hi all am having some issues with displaying nodes from a Changeable XSLT.
I just changed my content tree to
* Content
** Default
** Folder 1
// Sub Link 1
// Sub Link 2
** Folder 2
// Sub Link 1
// Sub Link 2
/// Sub Sub Link 2
/// Sub Sub Link 2
// Sub Link 3
/// Sub Sub Link 2
/// Sub Sub Link 3
This is the code am using in my XSLT but i can get the nodes to display
//fuji
Hey Fuji,
I would try the default SiteMap xlst and see how that works.
Rich
Rich,
I tried it but it wont give me the display same node when am on the default page.
I have tried to change the XSLT but still nothing showing up, when am on the homepage.
Any advise please
Rich,
Can you help me with that?? Am not getting the same output when am on other pages...can you tell me how to i display all the nodes of a parent and nodes of its child?
Hey Fuji,
Can you post an image of your content structure?
Rich
Hey Rich,
Basically I want to display all the nodes from Folder 2, but right now when am using this piece of code to draw all the nodes it giving me the nodes of from the currentPage am on and using a changeable XSLT
Hey Fuji,
In my opinion your structure is causing the problems.
Every Folder (1,2,3,4,5) in your structure is getting treated as a separate site.
How about changing your structure to:
- Default (Home)
- Folder 1
- Folder 2
- Etc.
- Members
I think you'll find your xslt will work better this way.
Rich
Rich,
But under my default (home) i will have more nodes there, those Folder 1 ~ Folder 2 are Galleries, Links that needs to be visible on every pages.
//fuji
Is there a way of displaying the child node of a specific parent node, instead of usint $currentPage?
Hey Fuji,
That's exactly what 'List Sub Pages by Changeable source does"
Rich,
Am getting only the Child nodes not even the parents. that is only the sub sub Links. Like my screenshot above am no getting the
Charter, Chair but only the Sub Like Structure , Secretary, Rules of Procedure
Fuji
That's because it's just showing the child nodes, it's not recursive.
You need to use recursive like the Site Map XSLT.
Rich
Thats what am using..
Thats what am using..
is working on a reply...