$site is the ancestor at level 1. / means children and // means descendants.
So you could also use this query if "Afdeling" exists at deeper levels.
$site/Afdelinger//Afdeling
I prefer to use English terms for aliases in general, but you can of course use Danish terms if you like - æ, ø, å and other special characters are automatically replaced.
Furthermore the config property "Allow items of type" should not be "Medarbejder" but "Ansat" (alias of the document type you want to pick).
Yes, in the razor expression you select all descendant nodes of type "medarbejder".
But in MNTP you choose a type "Content", "Media" or "Member" .. then you can choose a start node id (otherwise it will use -1, which is root id).
You can select a start node id by using the tree picker or specifying a xpath expression.
So, what you want when using xpath is to find parent id of "medarbejder" nodes. If this parent has different types of children, you can also use the filter option to only list specific nodes matching a document type alias.
No, I think the MNTP only select the first of the descendants and use that as start node id. E.g. in Fanoe starterkit if I specify LandPage as start node it will be the first of the LandingPage node and therefore only the children of this node.
so I can only select the first 3 textpage nodes. I have to make Home or root as start node and then filter document types to only "TextPage".
Listview has same issue if I set it as start node as listview node isn't shown and therefore no search box to search for the children.
I had a case to pick reviews in listview, but didn't want the entire site tree just to pick specific review nodes in listview, so we made a custom search for listview nodes using Web API and Examine - it also made in possible to show more details of each node than the tree expose via the entity and search services.
HI, I see this question is a few weeks old, but still marked as unsolved, so giving you my solution.
I had to do something similar, be able to pick news items from any site (multi sites on the instance) using the MNTP
Multinode treepicker - Xpath query - better documentation?!?
Hi guys I'm trying to understand how the "Query for root node with xpath" function works. And i think that the documentation is not very
But dont have any clue?!?
My site tree looks like this:
What I want is to show all the (Doctype: Ansat) nodes in the treepciker.
By razor i would do something like this:
But i have no clue how to do it with the xpath?!?
Any help would be nice :D
Hi Mads,
Can you try like :
Thanks, Alex
Hi alex, the problem is not code it self but the settings in the backoffice.
Mads, maybe you need to use 2 slashes ?
Hi Mads
How about a more site specific xpath query?
$site
is the ancestor at level 1./
means children and//
means descendants.So you could also use this query if "Afdeling" exists at deeper levels.
I prefer to use English terms for aliases in general, but you can of course use Danish terms if you like - æ, ø, å and other special characters are automatically replaced.
Furthermore the config property "Allow items of type" should not be "Medarbejder" but "Ansat" (alias of the document type you want to pick).
/Bjarne
Hi Bjarne - great description.
Sorry for my switching around ind doctypes :P
What I want is to get a complet list of all my nodes with the doctype of "medarbejder".
So i tried to do this:
But this gives me nothing ?!?
But if i understod your description , this xpath query should mean something like this(in razor):
Wich result in alle descendants with the doctype of "medarbejder" would be listed?!?
So what am I doing wrong?!?
Hi Mads
Yes, in the razor expression you select all descendant nodes of type "medarbejder".
But in MNTP you choose a type "Content", "Media" or "Member" .. then you can choose a start node id (otherwise it will use -1, which is root id).
You can select a start node id by using the tree picker or specifying a xpath expression.
So, what you want when using xpath is to find parent id of "medarbejder" nodes. If this parent has different types of children, you can also use the filter option to only list specific nodes matching a document type alias.
Your parent document type is "Afdeling".
or
/Bjarne
So no chance for selecting all descendants when they are spread out in multiple folders?!?
No, I think the MNTP only select the first of the descendants and use that as start node id. E.g. in Fanoe starterkit if I specify LandPage as start node it will be the first of the LandingPage node and therefore only the children of this node.
E.g. this xpath expression:
make this request:
so I can only select the first 3 textpage nodes. I have to make Home or root as start node and then filter document types to only "TextPage".
Listview has same issue if I set it as start node as listview node isn't shown and therefore no search box to search for the children.
I had a case to pick reviews in listview, but didn't want the entire site tree just to pick specific review nodes in listview, so we made a custom search for listview nodes using Web API and Examine - it also made in possible to show more details of each node than the tree expose via the entity and search services.
https://our.umbraco.org/forum/extending-umbraco-and-using-the-api/76057-return-camelcase-property-names-from-api-controller
/Bjarne
Oh, by the way.. I just remembered the great Mr N Picker: https://our.umbraco.org/projects/backoffice-extensions/mr-n-picker/
It does exactly what you are looking for - supports multiple root nodes.
/Bjarne
HI, I see this question is a few weeks old, but still marked as unsolved, so giving you my solution. I had to do something similar, be able to pick news items from any site (multi sites on the instance) using the MNTP
My content tree is like:
to start at the root, my 'XPath expression' is
and then 'XPath filter' is just the document type.
So then I can pick any news item from Site 1, Site 2 etc.
I am using 6.x but I think should work the same in 7?
Your tree picker unfortunately shows EVERYTHING in the tree, you just can't pick them (maybe this is different in 7?)
is working on a reply...