Sitecore query to select a child for the selected parent in multi-sheets

I need to get a sitecore request such that when we select any content element that from the same template that contains the multi-leaf, should show its own child element.

it should show only those elements that are associated with the immediate parent in the doc tree, for example:

If we have a tree structure: Claims - Requirement Doc1 - Requirement Doc2 Clause 2 - Requirement Doc3 - Requirement Doc4

Then, when we open claim element 1, it should show claim Doc1, Claim Doc2, and not others, and similarly, if we open claim element 2, it should display the Doc3, Claim Doc4 claim in multi-sheets.

thank

+4
source share
1 answer

Do you want the Multilist field to be populated with children of the current element? 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, simply put:

query:./*

to the source for your field.

You can only select elements based on a specific template using a query similar to:

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

(where you replace this GUID with the identifier of the template you want to find.

You can use the standard Sitecore query language to describe more complex queries. A useful Word document is available there that describes the query language in more detail . Plus the usual documentation on the SDN .

+3

Source: https://habr.com/ru/post/1548305/


All Articles