Wednesday, September 12, 2012

Site templates in SharePoint 2010

Site template is a very useful concepts in SharePoint 2010. Site template is nothing but a solution file with the extension of .wsp. Site templates stored in the solutions gallery of the top level site. Also check one article on  Detecting Memory Leaks in SharePoint 2010.

This is nothing but a package of everything like list, libraries, pages, sub sites etc. While packaging we can also save its contents like list items, documents, pages, custom pages, master pages and configurations. But some components like user permissions will not saved.

We can use the site template (solution file) in different site collections, but that server should contain the site definition files installed. Suppose you make the site template that internally derived from the Team site definition, then the other server should have Team site definition installed. Even if you have any content type used then those content types must be recreated in the other site collection.

The .wsp file is actually a cabinet file that contains a lots of xml files like elements.xml, Feature.xml, ONet.xml etc.

We can save the site as a template by using SharePoint designer 2010 or by using the browser.

By using SharePoint designer 2010:

First open the site by using SharePoint designer (Go to Start -> All Programs -> SharePoint -> Microsoft SharePoint Designer 2010). Then click on Open site and give the URL of the site.

Once the site is opened, from the site tab click on Save as Template as shown in the figure below:

This will open the  Save as Template page in the browser. For the rest of the steps we will discuss in the 2nd
option by using browser. Since afterwards both are same.

By using browser:

First open the site in the browser. Then go to Site Actions -> Site Settings.

This will open the site settings page, Navigate to the Site Actions section and click on Save site as template as shown in the figure below.

This will open the Save as Template page where you can give the File Name, Template Name, Template Description, and whether you want to include the content or not. Then click on OK as shown in the figure below:

When click on OK it will show a confirmation dialog box like below.

The solution is stored in the solution gallery. In my case the URL is


From browser also you can navigate to the solution gallery.
Go to Site Actions -> Site Settings-> From the Galleries section you can click on Solutions. You will get the site template that we have created just now.

No comments:

Post a Comment