1

When having just upgraded our old 6.x Sitecore solutions to 8, some content seem to be broken because html tags are getting rendered on pages.

But this problem was not there in Sitecore 6.x version. How to resolve this? I have tried to test it on multiple browser versions.

We have recently migrated our one of application from version 6 to version 8 and we are facing some issue. Here I am trying to get solution for one problem.

Content seem to be broken on pages as html tags start being rendered on pages. We have not made any changes in content and it was working fine in previous version.

What can be the possible reason?

2

This must be related to your field type. If you have HTML tags saved in Single-Line Text or Multi-line text field then it is expected behavior as the both Single-Line Text and Multi-Line are not supposed to contain any HTML tags in this version.

Text fields are not supposed to contain any HTML tags, but the Rich-Text Field is.

Another way we have tried to solve this problem is by extending the Sitecore RenderField pipeline.

 public void Process(RenderFieldArgs args) 
{ 
  Assert.ArgumentNotNull((object)args, "args"); 
  string fieldTypeKey = args.FieldTypeKey; 
  if (fieldTypeKey != "text" && fieldTypeKey != "single-line text") 
  { return;  } 

  args.Result.FirstPart = HttpUtility.HtmlDecode(args.Result.FirstPart); 
} 

You can use either way whichever works for you.

1
  • Thanks it did the trick. I have changed the type for one field and tested and it worked. Second one can be time consuming but I guess, I can live with first solution. Thanks Aug 19 '17 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.