5
votes

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

1

1 Answers

6
votes

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.