SharePoint 2010 content editor webpart edits generated code

3.3k Views Asked by At

Why is SharePoint so shit?

Firstly the content editor webpart gives you a nice message "Warning: The HTML source you entered might have been modified." when you insert some HTML via the "Edit HTML source".

And what's even worse, is that what you are editing is generated HTML, not the source HTML.

Lets say you have some markup that is modified and turned into a slider by some jQuery linked to in the master page. jQuery plugins generally add classes, add extra HTML around the original markup to achieve the desired functionality.

With the SharePoint 2010 page editors, you are presented with the markup AFTER it has been modified by JavaScript. What kind of idiotic approach is that??

I could have my source HTML in separate files, and simply link to them from each content editor webpart, but that makes maintaining pages a pain in the ass.

Is there a setting I'm missing somewhere? I assume there's a setting somewhere similar to the following

SPActLikeARetard = True

How can I change this to False?

1

There are 1 best solutions below

0
On

Another option is to the HTML Form Web Part (in the Forms category). This can be used to connect to other web parts, but more simply it can used to edit JavaScript directly in the web part. It seems that the rules for Content Editor Web Parts do not apply to the HTML Form Web Parts so it allows more flexibility.

Not the best, but will work.

It would be nice to have a markup editor web part which has not inteactive design besides controlling the markup that gets output by the webpart.