Get id of ancester-or-self from current node at specific level
Hi,
Standard requirement - I have sub-nav which I want to display on a parent page, and also on the child page, so I need to get the id of the ancester-or-self node from the current page at a parciular level then use this as the base for building the main subnav template. I can't seem to get the syntax right with the new schema, in grabbing the ancestral id. I have this:
So instead of going all the way up the tree (using ancestor-or-self), you only go ONE step up to the parent (by using /..) and then show all the docs under the that page.
Thanks Sebastian - that's not going to work for showing the same nav on two levels though, as it's always going to go up the structure once. It actually dawned on my whilst writing this that all I need is the standard 'get sub pages from level' script:
Get id of ancester-or-self from current node at specific level
Hi,
Standard requirement - I have sub-nav which I want to display on a parent page, and also on the child page, so I need to get the id of the ancester-or-self node from the current page at a parciular level then use this as the base for building the main subnav template. I can't seem to get the syntax right with the new schema, in grabbing the ancestral id. I have this:
I'm not sure how to modify the source select to target just @id for that node. Can someone shed any light on this?
Thanks!
This should work:
So instead of going all the way up the tree (using ancestor-or-self), you only go ONE step up to the parent (by using /..) and then show all the docs under the that page.
Thanks Sebastian - that's not going to work for showing the same nav on two levels though, as it's always going to go up the structure once. It actually dawned on my whilst writing this that all I need is the standard 'get sub pages from level' script:
Doh!
Thanks anyhow.
is working on a reply...