So I have three root nodes (Home1, Home2 and ContactPersons). In Home2 I have a document type Products which has a MultiNode Tree Picker for ContactPersons. The Contact person doc type has a property named 'show'. In the MNTP of Products I only want to choose contact persons where show has the value of 2.
The 'show' property is a Checkbox list with predefined values 1 and 2.
What XPath expression do I need to use so that I can filter the contact persons?
I now use //ContactPersons and this give me a list of all the contact persons, but I can't get the filter to work.
//ContactPersons[ContactPerson] same result as //ContactPersons
//ContactPersons[ContactPerson[@show=2]] shows me the complete tree node
Something you could try is using the $currentPage variable as the starting point for your XPath expression. Something like the following example which is off the top my head and untested but worth a try Upsers
$currentPage//product
or
$currentPage/descendant-or-self::Product
If you post up your current XPath expression it may also help others to understand where you are at already and provide more specific help.
How to use XPath in a Multi Node Tree Picker to filter on property value?
I have the following content tree
Home1 Home2 - products -> MNTP -> xpath select contactpersons where show=1 ContactPersons - ContactPerson1 -> show= 1 - ContactPerson2 > show= 2
So I have three root nodes (Home1, Home2 and ContactPersons). In Home2 I have a document type Products which has a MultiNode Tree Picker for ContactPersons. The Contact person doc type has a property named 'show'. In the MNTP of Products I only want to choose contact persons where show has the value of 2.
The 'show' property is a Checkbox list with predefined values 1 and 2.
What XPath expression do I need to use so that I can filter the contact persons?
I now use //ContactPersons and this give me a list of all the contact persons, but I can't get the filter to work.
//ContactPersons[ContactPerson] same result as //ContactPersons
//ContactPersons[ContactPerson[@show=2]] shows me the complete tree node
etc.
I hope you can help me :)
+1 to this, it has been 3+ years and xpath is still flakey (operating differently to the standard) and largely undocumented.
Something you could try is using the $currentPage variable as the starting point for your XPath expression. Something like the following example which is off the top my head and untested but worth a try Upsers
$currentPage//product or
$currentPage/descendant-or-self::Product If you post up your current XPath expression it may also help others to understand where you are at already and provide more specific help.
is working on a reply...