In Multi-Site Sitecore solution we allow user to load any site in Experience Editor with any Sitecore Site URL. We also provide an option to the user to create Sites on the fly. The problem we were facing was during Experience Editor. In Experience Editor you can make use of query string and get the Item based on sc_itemid. That was working absolutely fine. Now we provided an option to a user in Ribbon to change the color. Every Custom Site that user creates on the fly – each have their own fields to change the color. We were not getting the correct site because Webutil was providing the below information.
Speak Request URL: http://sc8.com:80/-/speak/request/v1/expeditor/ExperienceEditor.GenerateFieldUrl
Now in this request you don’t get sc_itemid – we wanted to get the actual item id (sc_itemid) based on the current Site which user has loaded in Experience Editor, so that we can show/load the correct option to change the color.
By this, we parse query-string and get the itemid, based on which we fetch the required content from Sitecore. So whatever is the context site, we didn’t bother of because we are getting the item based on above solution.
If you know any other solution, please write in comments.
Thanks to Damini who worked on this issue.