Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How do you tell if a page is customized/ghosted in SharePoint 2007? Can I use SharePoint designer? I know that customized pages have an "i" icon next to them. However, what about page layouts in the masterpage gallery? I don't see an "i" next to the page layout, even after I customized it.

Is there a sql query I can run to determine this for sure?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

I don't know about a SQL query, however you can use the following code block to test if a page is customized.

SPFile spFile = web.GetFile("_catalogs/masterpage/filename.aspx");
if (spFile != null && spFile.CustomizedPageStatus == SPCustomizedPageStatus.Customized)
{
    //spFile.RevertContentStream();
}
share|improve this answer
    
i've seen RevertContentStream() throw exceptions, for example for publishing pages, so you might want to consider trapping that or your code will break. Oh and thats only if you uncomment the line ;-) –  Anders Rask Dec 14 '10 at 22:11
    
Indeed. this block is part of a larger tast that does have relevant exception management. –  Clayton Firth Dec 15 '10 at 0:54

Doing a select against the content DB is a grey area in terms of supportability of your environment I think - some say that merely querying the content DB for information is ok provided you don't modify anything, other's (rightly*) say that circumventing all the security in place renders your environment completely unsupportable.

http://msdn.microsoft.com/en-us/library/bb861829.aspx

  • = my own opinion :)
share|improve this answer

For page layouts for SP2007 i can recommend using Gary Lapointe's reghost stsadm extensions. That is if your employer accepts reflection code on production environments.

http://stsadm.blogspot.com/2007/09/re-ghosting-pages.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.