Sitecore Experience Editor Renders JSON as Content

Blog | Technical
Written By: Baraa MahrokaPublished On: Sep 25 2017

For the past week, I was trying to figure out an issue related to the Experience Editor in Sitecore as it was rendering JSON as content. I started to search an existing solution to see if someone ran into it before, and yes! Obviously, a lot of developers saw this before and I found a lot of solutions. Unfortunately non of them worked for me. There is no one reason for this issue, it could be anything. As this was an upgrade project, I decided to install a clean Sitecore instance from the exact same version and revision and start comparing files. I started with replacing all core Sitecore DLLs from the clean instance into the upgraded instance. Unluckily, this idea did not fix the issue.  At a glance, I saw this what called webedit.css and I thought this might be the issue. I compared both files from both instances and there were a lot of differences. I decided to replace this file with the one from the clean instance, cleared my cache, tested the Experience Editor, problem solved. I suspect the old webedit.css found its way to the new instance through the migration process, maybe...

Steps to reproduce:

  1. Navigate to your Sitecore client.
  2. Pick an item with its Presentation Details set so you can view it in your Experience Editor.
  3. Go to Publish > Under Publish section choose Experience Editor. You will see something like the screenshot below:

Here are some solutions I came across:

  1. Ensure that Sitecore.MvcExperienceEditor.config file is enabled.
  2. Ensure that webedit.css file is getting loaded and accessible.
  3. Ensure your HTML is not causing any issue and properly closing your tags.
  4. Verify that you are not getting any jQuery conflict related errors.

My Resolution:

Note: Remember, this was an upgrade project and this resolution worked for me specifically for this project. It may help you out one day :)

  1. Install a clean Sitecore instance with the same exact version and revision.
  2. Replace your webedit.css file from your newly installed clean Sitecore instance, Usually located in C:\inetpub\wwwroot\Your Website Name\Website.
  3. Issue should be resolved.

Until next time!

About the AuthorBaraa Mahroka
Baraa MahrokaDevOps and Support Manager