HTML Field Control versus Content Editor Web Part

Normally, people feel strong temptation to use Content Editor Web Part (CEWP) whenever they need to display HTML content on a SharePoint page. There is nothing wrong in using CEWP as far as you know when to use it and what are the alternatives. Most of the time CEWP performs as needed but there are some scenarios where we should consider using Field Control (FC)  instead of using CEWP.

Please note that Field Controls are only available in Publishing sites and are designed to display HTML content as per the page layout. Here are some useful tips for when to use CEWP and when to use Field Controls:

Versioning (Use Field Control):

If you want to make sure you have full version history of a publishing page then use field control instead of CEWP because content of FC is stored in the list infrastructure and follow all the versioning capabilities of SharePoint. On the other hand, CEWP content is stored in ASP.NET profile infrastructure along with the URL of the page. It has no connection whatsoever with the versioning capabilities of SharePoint.

Content Targeting (Use CEWP):

If you want to display some content based on the context of the current user then you have no choice except using CEWP.  CEWP is a web part and any web part can be made visible by using Audience targeting. FC has no such mechanism of utilizing Audience targeting.

Want Strict control of User interface and Page Layout? (Use Field Controls):

If you don’t want to allow content editors to change the layout of your pages or to include javascripts then use Field Controls. FC just contains the value and can not include javascript. Only page designers are able to specify how each FC will be rendered on the page. Whereas, CEWP gives more power to the content editor which can lead to change the user interface elements by applying javascript and CSS techniques.

For further information, I will recommend to read this article

Share

1 thought on “HTML Field Control versus Content Editor Web Part”

  1. Your article contains incorrect information and should be updated. If you create page layout that has both a Field Control & CEWP on it. The content within the CEWP is 100% versioned with the page. Even if the control is CEWP removed and published the users can roll back to the version with the CEWP.

    The behavior you document was inherent to SP2007 Not SP2010

Comments are closed.