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 am very new to xslt. In my site, I have home as root, then under it I have peoples which contain people. I have Projects which contain project type. Home -peoples -john -peter -projects -project 1 -project 2 When I am on page project 1, how can I retrieve the a list of people under peoples? I tried /homes/peoples/ but it doesn't work. Can someone help? Many Thanks Jerry
Hi, Have a look at a short introduction of xslt xpath axes and their shortcuts at http://umbraco.org/documentation/books/xslt-basics/xpath-axes-and-their-shortcuts In your case, you'll need to traverse up the tree until you find a node with name = 'peoples' and list all child nodes from there... [code][/code] or [code][/code] Above snippet will yield results if you have the following structure: Home -peoples --john --peter -projects --project 1 --project 2 (At least I'm assuming that this is/should be the tree structure). Second snippet is much safer as it can rely on the alias of the document type rather than looking for the name (which can always be changed) Hope this helps. Regards, /Dirk
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
how to find root's child with specific nodename?
Hi,
I am very new to xslt.
In my site, I have home as root, then under it I have peoples which contain people.
I have Projects which contain project type.
Home
-peoples
-john
-peter
-projects
-project 1
-project 2
When I am on page project 1, how can I retrieve the a list of people under peoples?
I tried /homes/peoples/ but it doesn't work.
Can someone help?
Many Thanks
Jerry
Hi,
Have a look at a short introduction of xslt xpath axes and their shortcuts at http://umbraco.org/documentation/books/xslt-basics/xpath-axes-and-their-shortcuts
In your case, you'll need to traverse up the tree until you find a node with name = 'peoples' and list all child nodes from there...
[code][/code]
or
[code][/code]
Above snippet will yield results if you have the following structure:
Home
-peoples
--john
--peter
-projects
--project 1
--project 2
(At least I'm assuming that this is/should be the tree structure).
Second snippet is much safer as it can rely on the alias of the document type rather than looking for the name (which can always be changed)
Hope this helps.
Regards,
/Dirk
is working on a reply...