0
votes

I created a site in Sharepoint 2010 and exported it using "Save as template". That created a .wsp which I imported into Visual Studio 2010 and created a solution. That solution contains a web template (which is just an onet.xml file) among all the site pages and assets. So far, so good.

Now, I developed some web parts and added them to the project. Then I compiled and packaged everything, created a site in Sharepoint by selecting "Select template later", uploaded the .wsp into the site, and activated it. At that point all the webparts are created, and also the web template. So I go to the home page, and create the site with that template. But when the site is create from the template, all the web parts are deleted and replaced by Sharepoint basic web parts (Content editor, page viewer, ...).

Is there a way to include the web parts in the web template? I'm sure it's possible editing the onet.xml, but I'm not sure how.

Thanks in advance

1

1 Answers

0
votes

Have you tried manually setting up your web part page after the deployment? Then you can export the site as a template and then look at the resulting onet.xml file. That should give you some clues about the changes you need to make.