Can I use the xPath union operator when setting up a Multinode Treepicker?
Hi all, I'm trying to set-up a picker (Multinode Treepicker) and limit selections to two locations. I've worked out the two queries using the | operator (which is apparently a feature of xPath), for example:
query1 | query2
The result though is an error when loading the node: "An error occurred /
Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function."
Am I doing something wrong or is this unsupported?
I'm also happy for other suggestions about how to achieve this. My main requirement is that users can choose nodes of type X from a set of specific parents (type Y) but not all those parents 😵... I can provide a more specific example if that would be helpful!
I have done something simular to what yo are trying to do.
$current/ancestor-or-self::*[name()='pFrontpageCampaign' or name()='pFrontpageLocal' or name()='pFrontpageDistric' or name()='pFrontpageMain']//fFAQFolder
Thanks Lucas, this was really helpful, my expression does now at least seem to be valid:
$current/ancestor::*[name() = 'root' or name() = 'project']/sharedResources
Unfortunately the Multinode Treepicker only offers the root resources and not the project resources. I wondered if this was an ordering issue in the or (like in Javascript, offering the first value if it's not empty) but order isn't the issue. If I remove the root clause I am offered the project content, so at least both clauses work.
Can I use the xPath union operator when setting up a Multinode Treepicker?
Hi all, I'm trying to set-up a picker (Multinode Treepicker) and limit selections to two locations. I've worked out the two queries using the
|
operator (which is apparently a feature of xPath), for example:The result though is an error when loading the node: "An error occurred / Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function."
Am I doing something wrong or is this unsupported?
I'm also happy for other suggestions about how to achieve this. My main requirement is that users can choose nodes of type X from a set of specific parents (type Y) but not all those parents 😵... I can provide a more specific example if that would be helpful!
Hello Harry,
I have done something simular to what yo are trying to do.
or
Thanks Lucas, this was really helpful, my expression does now at least seem to be valid:
Unfortunately the Multinode Treepicker only offers the
root
resources and not theproject
resources. I wondered if this was an ordering issue in theor
(like in Javascript, offering the first value if it's not empty) but order isn't the issue. If I remove theroot
clause I am offered theproject
content, so at least both clauses work.It may be worth noting that I'm on Umbraco v9.
I will keep investigating.
I asked about this on Discord and Sebastian said all pickers only support a single root node (to his knowledge) so this is probably not doable.
Edit: opened a feature request/discussion at Sebasitian's suggestion: https://github.com/umbraco/Umbraco-CMS/discussions/12162
is working on a reply...