[MNTP] - XPath queries
# help-with-umbraco
m
Hello everybody, I’m new to using Umbraco CMS and have a question about XPath queries. I’m encountering unknown errors, such as not being able to use $root// to search for an element in descendant documents for use in a multi-node tree picker. Does anyone have any notes or advice on how to use this feature? I would really appreciate it! home (Document Type) └── blogs (Document Type with view ) └── blogItem (Document Type with view) └── categories (Document Type) └── categoryItem (Document Type) When I use $root//categories, it doesn’t work. In the network inspector, it retrieves the first categoryItem instead of categories. latest umbraco (13+)
s
I'd advise you to not use the XPath feature, as it is deprecated and removed in 14+. If you use dynamic roots, you can build out your query (https://docs.umbraco.com/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/content-picker#node-type) If you pick Root as the origin, then you can add Nearest Descendant Or Self (that matches your categories document type). That should put the categories node as the root of your picker, and then display the categoryItems for picking.
6 Views