2
votes

I have a multilist field inside of an item template that includes an XPath query to filter the item options.

query:/sitecore/content/mysite/Home//*[@@templatename='MytemplateName']

this works fine, but there are cloned items under /sitecore/content/mysite/Home which show up twice since there are two actual items in the content tree,

how can I alter this query to exclude duplicates?

1
Is @@ a typo or the source of the 'bug' ?Gilles Quenot

1 Answers

3
votes

You can check if the value of __Source field is empty.

In this field Sitecore stores information about the original item for cloned items, so this field will be not empty for all the cloned items and they will be omitted in the results:

query:/sitecore/content/mysite/Home//*[@@templatename='MytemplateName' and @__source='']