I want to create xslt file on a hierarchy which looks some thing like this .......
page 1
>1-sub page 1
>>chid sub page 1
>>child sub page 2
>1-sub page 2
>1-sub page 3
page 2
>2-sub page 1
>2-sub page 2
>2-sub page 3
page 3
>3-sub page 1
>3-sub page 2
>3-sub page 3
When i click on page 1 or 1-sub page 1 or child sub page 1 or any other child of page 1 ...then it should show thisin side bar.
>1-sub page 1
>>chid sub page 1
>>child sub page 2
>1-sub page 2
>1-sub page 3
same should happen with page 2 & page 3 nodes & there respective child node....
i was using "List all sub pages from changeble source" ....but problem is that if i have choosen page 1 as source then even if i go to page 2 or page 3 it dosent change .
This is what happens: on whatever child nodes this code gets executed ($currentPage), the parent node with the level of 2 from it will be selected and from there the for-each statement will work on all the direct child nodes. Since you also want to list the grand children another loop is necessary creating another ul in each li. What you definitely need to do is add some if statemets, e.g. if there aren't any grand children then don't even show the ul.
Get child nodes according to parents
Hello all,
I am very much new to xslt as well as umbraco.
I want to create xslt file on a hierarchy which looks some thing like this .......
page 1
>1-sub page 1
>>chid sub page 1
>>child sub page 2
>1-sub page 2
>1-sub page 3
page 2
>2-sub page 1
>2-sub page 2
>2-sub page 3
page 3
>3-sub page 1
>3-sub page 2
>3-sub page 3
When i click on page 1 or 1-sub page 1 or child sub page 1 or any other child of page 1 ...then it should show thisin side bar.
>1-sub page 1
>>chid sub page 1
>>child sub page 2
>1-sub page 2
>1-sub page 3
same should happen with page 2 & page 3 nodes & there respective child node....
i was using "List all sub pages from changeble source" ....but problem is that if i have choosen page 1 as source then even if i go to page 2 or page 3 it dosent change .
So please help me in this.
Assuming that page 1, 2 etc are on level 2 you can do the following:
This is what happens: on whatever child nodes this code gets executed ($currentPage), the parent node with the level of 2 from it will be selected and from there the for-each statement will work on all the direct child nodes. Since you also want to list the grand children another loop is necessary creating another ul in each li. What you definitely need to do is add some if statemets, e.g. if there aren't any grand children then don't even show the ul.
Hope that helps,
Sascha
Thanx Sascha Wolter,
I just added one codition of if & i worked properly ......
Great, glad we could fix that so quickly. :)
is working on a reply...