I haven't been able to get any XPath query with $current or $currentPage working with the nuPickers XML Dropdown Picker. Is this not supported or am I doing something wrong. I'm building a multilingual site, so I would like to start the xpath from the current node and not from the root.
XPath problem in Xml Dropdown Picker
In my MultinodeTreepicker I'm able to show a list of equipment with the following XPath query
$current/ancestor-or-self::HomePage[position()=1]/descendant::StandardEquipmentContainer
I would expect the following XPath query to show the same nodes with my nuPickers XML Dropdown Picker:
$current/ancestor-or-self::HomePage[position()=1]/descendant::StandardEquipmentContainer//*
I haven't been able to get any XPath query with $current or $currentPage working with the nuPickers XML Dropdown Picker. Is this not supported or am I doing something wrong. I'm building a multilingual site, so I would like to start the xpath from the current node and not from the root.
I'm using version Umbraco version 7.2.6
Any help would be appreciated.
John
Hi John,
The Xml DataSource supports the following token in an XPath expression:
so the following should do what you want:
the string token $ancestorOrSelf is replaced at evaluation time with:
where x is the current id, or the parent id (a new node doesn't yet have a current id)
HTH,
Hendy
Hello Hendy,
Thanks very much! Eventually this XPath expression gave me the equipment items in the StandardEquipmentContainer:
John
is working on a reply...