1

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?

3

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();
}
2
  • 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 ;-) Dec 14 '10 at 22:11
  • Indeed. this block is part of a larger tast that does have relevant exception management. Dec 15 '10 at 0:54
0

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 :)
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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