Home > SharePoint, SharePoint 2010 > SharePoint 2010 Bug: Inconsistent edit mode on pages – missing forms.css link

SharePoint 2010 Bug: Inconsistent edit mode on pages – missing forms.css link


In SharePoint 2010, pages in edit mode show fields individually boxed and labelled with the field name above as shown here:

However I recently found some pages showed differently as follows:

There was no apparent reason for this difference, with only the fields that differed between some of the page layouts.

Upon inspecting the page I found that pages which appeared as shown in the first screenshot linked to SharePoint’s forms.css, while the others did not.

After removing one field at a time, I found that adding the PublishingRollupImage field control to the page caused forms.css to be used by the page and the page showed as shown in the first screenshot, and removing this field control resulted in forms.css to no longer be used by the page as shown in the second screenshot.

I didn’t have time to look into this further and reflect the code to see why I had to add this field control for the page to display correctly in edit mode, so I resolved this instead simply by adding a link to Forms.css from inside an EditModePanel to ensure the pages would always display correctly in edit mode, regardless of whether this field control is used on any page layout. Using the CssRegistration control ensures that Forms.css will only be loaded once.

Advertisements
  1. July 15, 2011 at 20:58

    Just found this exact issue and thought I was going crazy! Thanks for the helpful post.

  2. Tyler
    August 12, 2011 at 03:52

    I second that … thanks you for posting this!

  3. Cesar Herrera
    December 30, 2013 at 15:50

    Could you please tell me where you added this field, for some reason all the forms in my site are loading the forms.css and any help or imput will be greatly appreciated,
    thanks in advance

  4. Jesper Wilfing
    February 7, 2014 at 10:46

    Good find sir! I can verify that this problem also exists in SP2013.

    Cesar Herrera: You could put it in the page layout for instance. Put it in an edit-mode panel:

    SP2013:

    • Jesper Wilfing
      February 7, 2014 at 10:48

      Maybe this will work better to paste code:

      <publishing:editmodepanel id="emp1" runat="server" cssclass="edit-mode-panel"> <SharePoint:CSSRegistration name="/_layouts/15/1033/styles/forms.css" runat="server"/> </publishing:editmodepanel>

  5. July 10, 2014 at 19:11

    Confirmed still exists in SP2013, and it can be triggered by Publishing:RichImageField.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: