Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Sitecore Droptree source to the item itself

I want to set the source of a droptree to the item so every time I create an instance of that template I can select it's children. Obviously I can't add the ID of the item to the template as it will be different for every instance of the template.

I tried $id in the vain hope that that might work but it didn't.

Is there a way to do this?

like image 723
Jon Avatar asked Mar 28 '12 08:03

Jon


2 Answers

I think you can just use a query and simply set the source to a relative path:

query:./*

This should set the source to the children of the current node.

Bonus: you can use most query expressions as source, making it possible to filter items based on templates or more complex operations. Check out the query doc at SDN to get started.

like image 96
Andreas Bergström Avatar answered Nov 13 '22 02:11

Andreas Bergström


You can always use simple XPath queries such as self:: or parent:: . For sets of items it could be descendant:: or child:: . But in your case I believe it will be self::

like image 31
Maxim Klakov Avatar answered Nov 13 '22 02:11

Maxim Klakov