mercoledì, giugno 13, 2007

Ghosting, Unghosting and...Reghosting with SharePoint Designer 2007

There is a great explanation of ghosted vs. unghosted pages in SharePoint at bluedoglimited.com:

 

  1. Go to Create | Web Part Page.  The page you create is “ghosted”.
  2. Open the page in FrontPage. 
  3. Make a change and hit save.  Your page is now “unghosted”.

 

Difference between #1 and #3?  Huge.

In #1, the ghosted page is basing its content from the template which exists on the file system.  The asp.net parser renders the page.

In #3, the unghosted page content is taken from the database.  When you saved the page in FP, the "template" contents from #1 were copied over to the database. All future versions of that page are now based off the database copy, not the file system copy. The page is now controlled by the SafeMode parser.

 

(Blue Dog has, incidentally, one of the few technical tools that can help with this issue: The GhostHunter Web Part.)

*

 

So…let’s say you have an unghosted page in SharePoint 2003 and you migrate it to SharePoint 2007. I was reading an excerpt from this article that makes it seem like SharePoint Designer can actually reghost the page!

 

When you perform a gradual upgrade, a customized (unghosted) page does not take on the new site definition (that is, the new functionality) by default. (However, there is an option to perform this action during a gradual upgrade; for more information, see Upgrade sites (Office SharePoint Server)

 

If you want the new functionality and features, you must reset any customized pages to use the site definition. Resetting the page essentially discards the customizations and attaches your pages to the master page and page layout. Any customizations you want can then be transferred to the master pages and page layouts instead of being stored in individual pages.

 

If you want to be able to use the new functionality with a customized page, consider using the Reattach to Page Layout command in Office SharePoint Designer 2007 to reset the page to the default version (reghosting). After you have restored the default page, you can then reapply your customizations in the browser by applying a different master page or page layout, or by reapplying the customizations in Office SharePoint Designer 2007.

 

For more information about resetting to the site definition, see Reset a customized page to the site definition.