Query Support on Rendering Datasources

I recently had a requirement for setting up datasources on standard fields of a templates in a multi-site.

So i needed the datasource of a rendering to point to a different folder for each site.





This job can be easily done on Template sources using Source but its a bit tricky when It Comes to Rendering Datasources.

As it turns out the Rendering Datasource has to be of certain format in order for Sitecore to call the rendering. If the Query Syntax is not appropriate, Sitecore would just skip the rendering altogther.

In order to achieve this, I had to make a custom pipeline that replaces Sitecore's EnterRenderingContext pipeline.

and registered the Pipeline

Now I was able to query Sitecore just like a normal query.


Leave a Reply

Your email address will not be published. Required fields are marked *