Sitecore: Publishing Issues and the Secret Desktop
One problem people often run into when dealing with sitecore is publishing issues. This is especially true when moving, deleting, and creating data source files. I recently had an issue in which datasource files that appeared to not be in sitecore were being shown in a view.
In this specific case, even though a parent data source element was only displaying a single child element, on the server five child elements were being displayed:
RenderingContext.Current.Rendering.Item.Children <– An array of 5 elements!
Even though my content editor showed this (The Rendering Item is the Additional Information Panel below):
Turns out that I was looking in the wrong spot. Sitecore also has something that I call a “Secret Desktop”. I coined this term myself (thank you very much!). To get to this location, you change to the desktop view, and select “web” from a tray in the bottom right corner. Once in this context, you can switch to your content editor again and view what REALLY is available to the .NET framework server and hence available to be sent to the browser:
In my case, there were artifacts left over from which I had already moved or deleted:
To resolve these publishing issues, I would recommend always checking
“republish children”, and always do a republish (as opposed to a smart
publish), when performing a publish in Sitecore. When you are in the
“Web” view, however, it is important to note that you should not modify
or change anything, as those changes will be overwritten when you
publish from the “Master” view.