Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sitecore query to select child for selected parent in multilist

Tags:

sitecore

I have to get such sitecore query by which when we select any content item which are from same template which contains multilist should show their own child.

it sshould show only those items which are related to immediate parent in doc tree for example :

If we have below tree structure : Claim 1 - Claim Doc1 - Claim Doc2 Claim 2 - Claim Doc3 - Claim Doc4

Then when we open Claim 1 item, it should show Claim Doc1, Claim Doc2 not the others and similarly in if we open Claim 2 item, it should show Claim Doc3, Claim Doc4 in multilist.

Thanks

like image 399
Esha Jain Avatar asked Jul 14 '14 06:07

Esha Jain


1 Answers

You mean you want the Multilist field to be populated with the children of the current item? You can write a relative query in the Source parameter for the Multilist field in your template. To find all the children of the current content item just put:

query:./*

into the Source for your field.

You can pick out only items based on a specific template by using a query similar to:

query:./*[@@templateid='{11111111-1111-1111-1111-111111111111}']

(where you replace that GUID with the ID of the template you want to find.

You can use the standard Sitecore query language to describe more complex queries. There's a helpful word document available which describes the query language in more detail. Plus the usual documentation on SDN.

like image 143
JermDavis Avatar answered Oct 21 '22 12:10

JermDavis