Tuesday, December 23, 2014

Don't embed data view web parts within wiki pages on a publishing site

The Problem

If you have created a publishing site in order to use the various features that are associated with that site template, you may see this error message when you are attempting to customize a new page created on the site within SharePoint Designer:


Content in the embedded form may be changed by the server to remove unsafe content  .Do you want to reload your page to see the results of the save?

If you have embedded various web parts, such as Data Form Web Parts on the page, and attempt to save the page within designer, you will see the above message.  Frustratingly, sometimes it allows your custom web parts to save and you can view them in SharePoint.  However, other times it will remove one or more of your web parts from the page upon save, and they are gone, for good.

The Solution

Instead of creating the default page type if you wish to embed web parts in a SharePoint publishing site page, open the site in designer and choose one of the Web Part Page types:


Even though SharePoint itself is still going to define it as a wiki page on your site pages screen, the markup that causes the unsafe content reminder is not included.  So you can save without worrying about loosing any markup on save.

That's it.  Save yourself some headaches and choose this page type right from the start.

No comments:

Post a Comment