Ghosting and unghosting is quite the popular topic ... Hopefully, today’s post will answer the last remaining questions... J
Ghosted pages or ghosted sites?
For starters, let’s all get on the same page – the terms “ghosted” and “unghosted” refer to the state of a Web Part Page.
All too many times, I see folks using the expression “I have an unghosted site”.
BZZZZZ!! Wrong answer.
There is no such thing as an “unghosted site”. Keep in mind that ghosted/unghosted refer to a page state. You may have a site with unghosted pages, but the site as a whole can never be unghosted.
Meta-data and unghosting
In my original post from June 2004 that described ghosted pages, I mentioned that “modification of custom document library fields” will force a page to transition over to an unghosted state. To be fair, the word “custom” could be eliminated from that statement because every column is effectively a custom column.
This is a commonly overlooked fact. Why? If you’re not totally familiar with how SharePoint handles documents, the concept just doesn’t come naturally. Thus, the following question is commonly seen...
Q: Why does changing the meta-data associated with a Web Part Page in a document library cause the page to be unghosted?
There are two reasons!
- Property promotion and demotion
- Performance
If you’re not familiar with property promotion, I strongly encourage you to read Daniel McPherson’s post “SharePoint Document Libraries and Property Promotion”. Whenever you change the meta-data associated with a Web Part Page, SharePoint will attempt to demote the properties into your aspx page. To ensure your page will always have the correct meta-data that is represented in your document library, the data must be persisted in the document itself. This obviously requires a page to contain unique data and therefore unghosts the page. (Note: this is very reason why changing the Title via FrontPage 2003 will unghost your page as discussed in my post from May 11th).
The secondary reason is related to performance optimizations designed to improve page rendering times. When you save a custom page, the web part framework will parse the page to determine the number of web part zones, their identification, and their properties. This data is cached as part of the overall meta-data and is used to quickly match web parts to their parent zones.
-Maurice
References:
Ghosted and unghosted pages - part 1 of 2
Ghosted and unghosted pages - part 2 of 2
Untruths about ghosts
Don't kill the messenger ...