Am so confused and lost in my XSLT atm. Am Trying to display all the nodes present under a specific Folder with the following id(1168) but am only getting the Sub Nodes of a Child and not even the parent. Anyway what am trying to do is to be able to view all the nodes of a specific folder.
<!-- The fun starts here --> <ul> <xsl:call-templatename="drawNodes"> <xsl:with-paramname="parent"select="umbraco.library:GetXmlNodeById($source)/* [@isDoc and string(umbracoNaviHide) != '1']"/> </xsl:call-template> </ul> </xsl:template>
An apologies to Tommy because I hadn't seen that you had proposed the same example, as I did. And you had added that the * could be replaced by decendants::*
Drawing All Nodes of a specific Parent
Hi All,
Am so confused and lost in my XSLT atm. Am Trying to display all the nodes present under a specific Folder with the following id(1168) but am only getting the Sub Nodes of a Child and not even the parent. Anyway what am trying to do is to be able to view all the nodes of a specific folder.
Content
Default
Folder 1
Link 1
Link 2
Sub Link 1
Sub Link 2
Link 3
Hi Fuji, you could do something like this to get the children of node 1168:
<xsl:for-each select="umbraco.library:GetXmlNodeById(1168)/* [@isDoc][string(umbracoNaviHide) != '1']">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="@nodeName"/>
</a>
</xsl:for-each>
The * can also be substituted with specific node-type-names or xpath specifiers (like descendent::* ...)
>Tommy
Hi Tommy am using this piece of code at the moment..
But only getting the Sub Node of the Child that is in my cas Sub Link 1 and Sub Link 2
Btw id (1168) is for the Folder 1 node..
Fuji
You go 1 step too deep in your template call/for-each (in your for-each the parent is actually one of your $source children)
So e.g. replace
with
Hi Fuji
I was just doing a little local example. Where I've the following XSLT code to get all nodes out, based on a specific node.
So maybe you could try something like this
And the two slash characters represent the descendant axis. So it will get all childs and thir childs, and so on.
Hope it can helps you.
/Dennis
An apologies to Tommy because I hadn't seen that you had proposed the same example, as I did. And you had added that the * could be replaced by decendants::*
I´m sorry
/Dennis
Dennis no worries - you supplying an answer, trying to help out on the forum is important. Hopefully one of the posts will solve the problem.
Thanks Dennis its working...can you tell me how i can get the subPages to get a class so that the links indent?
Hi Fuji.
Did you find a solution on how to add a class to subpages so that the links will be indented
/Dennis
Hi Dennis....
I tried the above code in my previous post but its not indenting the subpages, the only thing working so far is the active current page.
Any suggestion what i did wrong?
//fuji
Hi Fuji,
I've tried some different things yesterday, but I did not find a solution on how you can get subpage to be indented.
But hope you find a solution.
/Dennis
Hey Dennis,
Yes got it working, if you need some help on this i'll be please to share.
//Fuji
Hi Fuji,
I know it is an old question. But I do not know if you found a solution.
I have sat and tried to solve a similar question tonight and got the inspiration for the solution to your question.
The code below gives you all the subpages for each page. These subpages is indented under the page they belong
I'm not quite sure if it's the best way to solve this problem at.
/Dennis
Ahh hadn´t seen you found a solution to the issue. This may be another way to solve the same problem on.
/Dennis
Hey Dennis,
Yes got it working.....how about your solution is it working if not let me know ill try out.
//fuji
is working on a reply...