Monday 1 October 2012

Oi! My Content Editor Web Part is Borked!

Had an issue today where I got an email saying "ever had this error before?" It was a Content Editor Web Part (those thingies that allow you to add fancy text to a SharePoint page via a web part) that was causing the browser to throw errors. The browser was apparently failing to recognise the background colour or some other bit of javascript. Also the context menu that dropped down from the "edit" command on the web part - viewable when you select "Edit Page" - was not dropping down. The whole thing seemed borked.

I tried adding in a few other Content Editor Web Parts and for the most part they broke in the same way. I closed them using the Web Parts Maintenance Page (which is like the regular page only you add ?contents=1 to the URL) and then had a look at the original web part. Clicking Source Text Editor, I noticed the following.
<DIV blah blah blah piles of attributes that looked as if they'd been lifted out of MS Word etc etc>
<p>Text</p>
</DIV>

Since the DIV contained no text or formatting, I deleted it and refreshed the web part. Hey presto, the borkedness was fixed. The tags were interfering with the HTML. Interesting indeed if this is being caused by SharePoint's very own Rich Text Editor!

No comments:

Post a Comment