Syntax question: ancestor-or-self but not 'cousins'
I'm using this to select links attributed to pages above my currentPage
$currentPage/ancestor-or-self::Site//Link [@isDoc and umbraco.library:GetXmlNodeById(@parentID)/@level < $currentPage/@level ]" />
I'm just wondering if there's a different way of putting the first line in that that would negate the necessity of the second? My problem being without the second if shows links from similar level nodes down a differenct branch of the tree
the thing is that you are using //Link this says everybody on my level including cousins. If you remove that then it will only take from currentPage branch and nothing else.
Syntax question: ancestor-or-self but not 'cousins'
I'm using this to select links attributed to pages above my currentPage
I'm just wondering if there's a different way of putting the first line in that that would negate the necessity of the second? My problem being without the second if shows links from similar level nodes down a differenct branch of the tree
the thing is that you are using //Link this says everybody on my level including cousins. If you remove that then it will only take from currentPage branch and nothing else.
scott
sorry I did not specify well enough
instead of //Link then you should use /Link the double // says everybody beneath me and on all equal levels
eg.:
- root
- site 1
- link 1
- site 2
- link 2
Url: root/site 1/
//Link gives (link 1 and link 2)
/Link gives ($currentPage branch link 1)
Url: root/site 2/
//Link gives (link 1 and link 2)
/Link gives ($currentPage branch link 2)
I think I follow that.
I want something like this
- root
- link 1
- site 1
- site 1 subpage
- site 2
- site 2 subpage
- link 2
When on site 1, site 1 subpage or site 2, link 1 will display
On site 2 subpage only link 2 (this is handled by another select)
Using
Shows link 1 only on root
is working on a reply...