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

In our SP2010 publishing site we have a lot of content (publishing pages) which are associated with custom page layouts. These page layouts have previously been edited on the server using SharePoint Designer, which we believe means they are now stored in the content database - which we understand is referred to as being "unghosted".

We are now trying to do a deployment of a package which includes new versions of these page layouts. The deployment appears to work; the new page layouts are stored on the filesystem, but do not actually get used because SharePoint prefers to use the ones already in the content database instead.

We have tried deleting the page layouts using SharePoint Designer (so the newly deployed ones on the filesystem get used), but we can't because there is lots of content using them.

We would like to be able to disassociate the existing content from these page layouts so we can delete the page layouts from the content database (using SPD) and deploy the new, packaged versions of the page layouts to the filesystem (and never edit the page layouts in SPD again!).

Is this approach possible? If not, any ideas on a different approach which doesn't require us to delete all our content first, as there is lots of it!

share|improve this question
    
I had exactly the same problem. Ended up using the approach suggested by MLF. sharepoint.stackexchange.com/questions/22215/… –  Rob Windsor Nov 18 '11 at 20:29
add comment

2 Answers

up vote 2 down vote accepted

If you want to deploy using a wsp, you could add a feature receiver which makes sure the page layouts are updated when you deploy them.

This blog post has an example of using a feature receiver to checkout, update and publish a change to a page layout: http://falakmahmood.blogspot.com/2011/09/sharepoint-2010-updating-masterpages.html

This would enable you to update the page layouts in a controlled manner while the content is still attached.

share|improve this answer
    
This worked great. Thanks! –  Nick Dec 2 '11 at 14:29
add comment

Are those pagelayout initially created in SharePoint Designer? If so, make sure that you remove the SharePoint Designer metatags (available in the page directives) before you place them in Visual Studio for provisioning. Those metatags are evil. They ensure that the pagelayout will be "unghosted" after provisioning!

That said, I think provisioning of another WSP is a little bit overkill. You can easily reset your pagelayouts (make them ghosted again) - by right-clicking them in SharePoint Designer and select "Reset to site definition" OR by using the UI. SiteAction -> Look and feel-> Reset to site definition

share|improve this answer
add comment

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.