Home » SharepointRSS

Deploying master pages in sharepoint 2007

Present situation:

 

Client has dev environment and they have customized the default page which comes ootb and is in Page Library. Also Created Master page using Sharepoint designer, and made that master page as the default master page for the site.

The proposed solution:

For promoting to different environments we will have to move packages WSP's across environments.

 

The present situation:

All the environments were restored by using site collection backup and restore option (stsadm -o restore ...)

 

The Problem:

Can we overwrite the master pages, page templates which are presently in master page gallery and page library by using feature

 

Or is there a better way of doing this.

 

Can somebody specify a better option for promoting.

 

 

6 Answers Found

 

Answer 1

Hi,

You can't deploy using a standard feature with a <Module> as the file already exists and SharePoint will ignore it, even if you set theIgnoreIfAlreadyExists to false on the <File> element.  A solution could be to use the following custom STSADM command

Upload Masterpages and Page Layouts: http://msdn.microsoft.com/en-us/library/ms459213.aspx

I created this as I was in a similar situation to yourself where a non developer made customisations and wanted them deployed to another environment.  You can browse the masterpage and page layout gallery, select the dropdown menu on the file and send to > download file.  You can manually copy to the destination server and upload each file to the masterpage and page layout gallery, publish major version and approve but if you have many files this can be time consuming so I opted to create a new STSADM operation.

Hope this helps

Dave

 

Answer 2

Hello dave,

 

Can you give me that command I could not get that in your reply.

 

I also tried to do the following way:

 

1. Took backup of the files by downloading them to file system.

2. Manually delete the pages  from designer (_catalogs/master pages, Pages/default.aspx)

3. Now tried to deploy them through feature.

 

But I found lot of errors after deployment. Can you suggest me if I followed the correct way of doing this.

 

I also read that we can achieve this by FeatureActivated event handler.

 

Answer 3

Sorry dreaded copy and paste.   Here's the link http://uploadplmp.codeplex.com/ .

When you say pages/default.aspx have you modified the page or the page layout?

You can do it with a feature receiver as the SharePoint API supports calls for provisioning files, publishing and approving.

 

Answer 4

Hello Dave,

 

the pages/default.aspx is customized using designer. There is also a custom master  page (created in designer) in master page gallery. Te default.aspx uses the custom master.

 

So as you said using feature receiver can I overwrite the master page and default.aspx using feature receiver.

 

 

Answer 5

Hi Dave,

 

Regarding the STSADM command that you suggested me. Will this give an option to save the files in file system also like a feature

 

Answer 6

No it won't its a different approach.  As I explained above you cannot use a standard feature which provisions the file using a <Module> as the file already exists.  You could write a feature receiver which contains similar code to the stsadm command.
 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Tech Videos   |   Follow us on Twitter