Posts

Showing posts from April, 2022

Referencing local data sources using ID instead of path

Image
In my previous blog post  we discussed about the problem with renaming local data sources and the issue with converting data sources created in a hierarchical structure to IDs using the out of the box PowerShell script. In this post I am going to show how to prevent using path to reference local data sources in the first place. Sitecore decides on whether to use ID or path to link data source to the rendering in presentation details at the time of selection of data source using the Select Associated Content dialog. So, I decided to take a look into what's happening behind the scenes when you click OK on this dialog using the network traffic monitor in the browser developer tools. I noticed a call to the following URL with the below response. https://demo.dev.local/sitecore/shell/default.aspx?xmlcontrol=Sitecore.Shell.Applications.Dialogs.SelectRenderingDatasource&... The response has a command called SetDialogValue with the path of local data source as value. The same call ha