If you want to deliver the high quality Customer Experience website then the first thing you will go for is Personalized content and for which in turn we create the component based website. And to make these components reusable we pitch in for Datasources.
To ensure that the site is Content Author friendly, we need to set Datasource Template and Datasource Location for each rendering that is using Datasource. If you want to know how to achieve this, you can refer the blog.
Now while we set the Datasource Location, what if we have two different locations? Like local and global datasource? How can we give both the options to Content Author to select from?
This is achievable using OOTB Sitecore feature.
Scenario: I have a Food details rendering which needs datasource to display the content. And uses Data Template as Food Template.
Now we have two different locations from where the datasource can be selected: Local > Home/Indian Foods & Global > Global/Foods
Resolution: To achieve this, we will need to go to Food Details rendering >> Datasource Location field under Editor Options section and Enter the path of both the datasources separated by pipe. Ex. /sitecore/content/Home/Indian Foods|/sitecore/content/Global/Foods
Now you or Content Author should be able to select the Food item either under Foods or Indian Foods when using Food details rendering.
In this blog, we learnt about using multiple datasource locations for a single rendering.
Thank you.. Keep Learning.. Keep Sitecoring.. 🙂