We have migrated from Sitecore 7.2 to Sitecore 9.1 version and maintaining four websites.
Since it is a multi-site solution and they wanted to use the field "Datasource Location" and "Datasource template" on sublayouts to open the datasource selection that would help content author to select the datasource folders dynamically. For that purpose, they have added below custom module earlier. Below is the code.
We have migrated from Sitecore 7.2 to Sitecore 9.1 version and maintaining four websites.
Since it is a multi-site solution and they wanted to use the field "Datasource Location" and "Datasource template" on sublayouts to open the datasource selection that would help content author to select the datasource folders dynamically. For that purpose, they have added below custom module earlier. Below is the code.
public class GetQueryableDatasourceLocation
{
public void Process(GetRenderingDatasourceArgs args)
{
foreach (var location in
new ListString(args.RenderingItem["Datasource Location"]))
{
if (location.StartsWith("query:"))
{
Item contextItem = args.ContentDatabase.Items[args.ContextItemPath];
if (contextItem != null)
{
string query = location.Substring("query:".Length);
Item queryItem = contextItem.Axes.SelectSingleItem(query);
if (queryItem != null)
{
args.DatasourceRoots.Add(queryItem);
}
}
}
}
}
}
It has been added in the getRenderingDatasource pipeline.
We are going to develop a new website using SXA. Whenever we use any components (Rich Text or Promo, Carousel etc), it is keep loading in the experience editor and getting below error in the logs.
Further Reference: https://sitecoreblog.blogspot.com/2012/06/sublayout-queryable-datasource-module.html
Has anyone come across this scenario and How to resolve the issue. Kindly share your inputs?