Creating a consistent brand experience in SharePoint is a rewarding feeling. There's something satisfying about going to each page and having a similar look and feel. Try as you might, there's always going to be an exception where a page, or a site falls outside of the branding aesthetic. In this post I'll show you a clever branding solution that'll empower end users and prevent governance heartburn for your SharePoint support team.
Now create a page layout for the content type.
At the top of your page layout, add this:
Then, in the main content area, add this:
Where you want the Edit Mode Panel to reside on your page layout, add the following:
Here’s the code-behind:
Publish the page layout and deploy that code. Now when you edit the page you'll have the new fields in the page layouts and users can get styling and scripting in no time!
Users can go forth and style web parts, a table in a publishing field, and whatever else is on the page. Just be sure that the code contains the appropriate tags such as <style> and <script>. SharePoint isn't that smart.
I cannot recommend exposing these fields on every page layout on every page, because what's the point of branding then? These should only be exposed when needed. Additionally, your security model on your site should ensure that not any Tom, Richard, or Harry can edit pages.
The sky is really the limit with this solution. The best part of this solution is if the page goes sour, it won't bring down the site for everyone; just a page. All the fun of master page branding with none of the ramifications!
In the interest of full disclosure, I can’t take credit for this solution. Credit goes to Steve Samnadda for coming up with this. He would have blogged about it but he's too busy putting out the world’s SharePoint fires.