2

So I have a multilist with search field that I ONLY want to add the items under my home folder per region. So I want my us site settings file to only pull in the US home items and then the CA Site settings to bring in CA only home items.

enter image description here

Currently my query is returning all of the items under CA, UK and US. Here is my query figure its something small but cant track it down.

query:../home//*[@@templatename='ContentPage_LeftNav' or @@templatename='ContentPage']

1 Answer 1

2

The problem is you are using a Multilist with Search field, but supplying it with the source query used for a standard Multilist field.

On the Multilist with Search field, you are writing a query against the index vs using Sitecore Query.

Start with StartSearchLocation, in your case you would want something like StartSearchLocation=/sitecore/content/US/home, then you can add in a template filter, using the Guids of the templates vs the template names. So the source field would look something like:

StartSearchLocation=/sitecore/content/US/home&TemplateFilter={GUID}|{GUID2}

If you wanted to have your StartSearchLocation relative to the current item you are on, then you can use a query there too like this:

StartSearchLocation=query:./../home&TemplateFilter={GUID}|{GUID2}

References: https://thecodeattic.wordpress.com/2017/01/17/multilist-with-search-secret-sauce/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.