Upgrade page layout with sharepoint feature

989 views Asked by At

I use sharepoint 2010. I have a feature which contains some pages layout. When the feature is activated, page layout are applied. But when I deploy a new version of this feature with a new version of pages layout, page layout aren't take into considerations because they have the same name.

How can i do this ?

1

There are 1 answers

0
Kimzter On

Your page layouts won't update because they're unghosted, i.e. customized in the Master Page Gallery.

It has nothing to do with the files having the same name unless you've explicitly set IgnoreIfAlreadyExists to FALSE in your elements.xml in the feature.

If your solution doesn't contain any important pages yet (development server or otherwise), the simplest solution is the following:

  1. Delete the page layouts, (making sure no pages reference the page layouts in question, else you won't be able to delete them.)
  2. In Central admin, uncheck "Allow Site Collection Administrators to Customize Master Pages and Layout Pages" ( see http://blogs.msdn.com/b/steve_fox/archive/2010/03/08/ghosting-unghosting-in-sharepoint-2010.aspx for details).
  3. Redeploy your solution

See also http://blogs.technet.com/b/wbaer/archive/2007/08/10/ghosts-in-the-machine.aspx for a thorough explanation of ghosting and unghosting in SharePoint

Hope this answers your question.