Multiroot Treelist with datasource queries

Sitecore Asked by MEENU CHAUHAN on September 26, 2020

We had a requirement that we need to show 3 template locations in a Tree List field. We found similar questions here – Multi-root treelist with queries, and created a multi-root treelist by following the above question, but we are unable to find the exact Datasource query that we need to use. We need to show only the required template and hide all other templates.

We tried the following queries –

query:/sitecore/templates/User Defined/Page Templates|/sitecore/templates/User Defined/Item Templates

datasource=/sitecore/templates/Page Templates&IncludeItemsForDisplay=Template1,Template2,Template3&ExcludeTemplatesForSelection=Template Folder&IncludeTemplatesForDisplay=Template|datasource=/sitecore/templates/Item Templates&IncludeItemsForDisplay=Dmat document&ExcludeTemplatesForSelection=Template Folder&IncludeTemplatesForDisplay=Template

But didn’t get the actual results. Can you please help us?

One Answer

Try to apply datasource query like this -

datasource=/sitecore/templates/Page Templates|/sitecore/templates/Item Templates&IncludeItemsForDisplay=Template1,Template2,Template3&ExcludeTemplatesForSelection=Template Folder&IncludeTemplatesForDisplay=Template

This will give you multi-root paths.

Correct answer by Gaurav Agarwal on September 26, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP