I'm on Sitecore 8.2, using MVC. I have two sites, and I'm defining presentation details on Standard Values of the template, so that I can use one presentation details setup for rendering the same component on both sites, just with different content.
When putting the component (rendering) on the page, we have this field for choosing the datasource item: Here I can either use "Browse" link to find the exact Sitecore item to use, or I can enter a query expression like on the screenshot. I've added a custom processor into mvc.renderRendering pipeline that interprets that query expression and replaces the query with the exact path to the item.
If I'm on site A it will give me path
sitecore/content/siteA/controls/navigation and if I'm on site B it will give me path
It all works very good for me.
The problem is when I need to personalize the component. Based on some condition, I would like to change the datasource of the component to be:
But, the problem is that the "Content" field in the personalization window is not allowing me to enter the query. It only allows me to choose the individual item: The only workaround I have found so far is to choose the individual item here, and then go to raw values of presentation details (__Renderings field) and replace the guid there for my query expression.
That works, but it's clumsy, and there's no way content authors will know how to do that if they had to.
Is there a way in the personalizations window to get the same kind of Data Source field as in the component properties window (the one that allows free text entry along with browsing for individual Sitecore item)? Or any other solution for this problem?