Vikram
Vikram

Reputation: 713

Sitecore Query for DropTree Field

I want to assign DropTree field source,so user can only select the children of the current node in the field. I tried with this:

query:./child::*

& this as well:

query:./*

both these returning the first child & not the all children.

What I'm doing wrong here?

EDIT

Here the structure:

if I try query:../* it always return the children of first Service category.

Upvotes: 4

Views: 2793

Answers (1)

Marek Musielak
Marek Musielak

Reputation: 27132

For Droptree field the source query only specifies the root of the tree. That's why you need to select the node itself, not the children of the current node. Use

query:./ancestor-or-self::*

It will allow to select any descendant of the current item.

Upvotes: 6

Related Questions