Datasource with Multisite – Sitecore Queries

This article is really small but covers good thing which we (The developers) may not considered to while implementing solution. Its about restrict the selection to the Editor or Author.

Answer is Sitecore Query. There are many articles around this i have added some good articles of links in this blog but yes, lets have some examples to configure simple selections:

Scenario 1: Consider we need to give option to Author to select Countries which are common or restricted to the site. Consider its Multisite as well. below is an example.

Here below is the datasource:


Which says retrieve children of Item created from “Countries” template that is a Home node, a child of Item created from the template “WebsiteFolder“.

Below is the screen about content tree where there are 2 sites (Site1 and Site2) and both have different countries. by writing above query in datasource


And the result is for Site1:


And for Site2:


Scenario 2: Normally we use to have an option to select may be a search page or contact us page of the existing site, example Site1. Below could be a datasource to select page inside the Site1 only.
2017-05-22 06_27_57-Desktop
FieldType is: Treelist


Which will list items in the Treelist starts from Home of the Site1.
2017-05-22 06_31_15-Desktop

I will add more references in this article about sitecore queries.

Happy Coding….

Note: Sitecore queries may decrease performance of your application so be careful while using Sitecore queries


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

Create a website or blog at

Up ↑

%d bloggers like this: