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!

Related Questions

How to get General Link Field in RenderFieldArgs?

0  Asked on August 23, 2021 by gautam-aneja


Setting site default language in SXA

1  Asked on August 23, 2021 by mohamed-mosa


Sitecore domain and sub domain authentication

1  Asked on August 23, 2021 by suresh-r


No data recorded in Experience Analytics

3  Asked on August 23, 2021 by breno-diniz-pelosi


GraphQL query to search for pages based on template

2  Asked on August 23, 2021 by serhii-shushliapin


Sitecore SxA Composite Layout not adding custom css and js

1  Asked on August 23, 2021 by nadine-lendzian


Sitecore Item URL with Custom Domain in Azure PaaS

2  Asked on August 23, 2021 by alok-kumar


Updated field in rendering variant not working

2  Asked on August 23, 2021 by barada-behura


Creating multi site using Sitecore JSS

1  Asked on August 23, 2021 by haappyy02


Scale Out Content Management AppService

1  Asked on August 23, 2021 by pirate-briggs


Use SXA rendering variant for dynamic object

1  Asked on August 23, 2021 by user2980


Custom Item Url Builder

1  Asked on August 23, 2021 by ethan-schofer


Ask a Question

Get help from others!

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