With Microsoft SharePoint Designer 2010, you can design and build robust SharePoint applications that include a rich set of data sources, customer-facing views and forms, highly customized workflows, and more. Once you’ve built your business solution site, you can start using it right away in your SharePoint environment. Or, you can turn your solution into a template and deploy it in another environment, make it available to users so they can create new sites from it, or hand it off for further development in Visual Studio.
Turning your customized site or business solution into a template is an extremely useful and very powerful capability in SharePoint 2010. Once you start to package your solution as a template, you begin to realize SharePoint’s potential as a platform for business applications.
This article describes SharePoint templates, what they’re used for, how to turn your site into a template, and how to activate that template on the server.
In this article
What is a SharePoint site template?
SharePoint site templates are pre-built definitions designed around a particular business need. You can use these templates as they are to create your own SharePoint site and then customize the site as much as you like. You’re probably familiar with the default site templates, like Team Site, Blog site, and Group Work Site as shown here.
In addition to the default templates, you can create your own site template based on a site you’ve created and customized in SharePoint. This is a powerful feature in SharePoint that allows you to create a custom solution and then share that solution with your peers, the broader organization, or outside organizations. You can also package the site and open it in another environment or application like Microsoft Visual Studio and further customize it there.
When you save your site as a template, you create a Web Solution Package, or WSP. A WSP is a CAB file with the solution manifest. The solution you create gets stored in the Solution Gallery for the SharePoint site collection. From there, you can download a copy of the solution or activate it on the server.
Note The WSP you create is a partial trust user solution that has the same declarative format as a full trust SharePoint solution. However, it does not support the full extent of feature element types that are supported by full trust solutions.
Top of Page
What gets saved in a template
When you save your SharePoint site as a template, you’re saving the overall framework of the site – its lists and libraries, views and forms, and workflows. In addition to these components, you can include the contents of the site in the template, for example, the documents stored in the document libraries. This could be useful to provide sample content for users to get started with. Keep in mind that this could also increase the size of your template beyond the default 50 MB site template limit.
Most of the objects in a site are included and supported by the template. There are a number of objects and features not supported however. The following table provides a quick summary of what’s in and what’s out of a typical site template, or solution.
|Included in user solution WSP
||Not included in user solution WSP
- External Lists
- Data source connections
- List views and data views
- Custom forms
- Content Types
- Custom Actions
- Site pages
- Master pages
- Customized permissions
- Running workflow instances
- List item version history
- Workflow tasks associated with running workflows
- People/group field values
- Taxonomy field values
- Publishing pages and publishing sites
- My Sites
Top of Page
What can you do with SharePoint templates?
Saving a site as a template is a powerful feature because it offers so many different uses of custom sites in SharePoint. Here are the immediate benefits you get from saving a site as a template in SharePoint.
- Customized SharePoint sites can be deployed as solutions immediately Save and activate the template in the solutions gallery and let other employees create new sites from this template. You don’t need Visual Studio to create your solution, and you have to access the server directly and run server administrator commands. Just save the site as a template, activate it, and off you go.
- Customized SharePoint sites are portable – In addition to deploying a custom solution in your environment, you can download the .wsp file, take it on the road, and deploy it in another SharePoint environment. All of your site customization is conveniently stored in one file.
- Customized SharePoint sites are extensible – As a Web Solution Package, you can open your customized site in Visual Studio, perform additional development customization to the template and then deploy it to SharePoint. SharePoint site development, as a result, can go through a site development lifecycle that includes SharePoint Designer 2010, Microsoft Visual Studio, and the browser.
As you begin creating custom sites in SharePoint, you’ll discover even more benefits to turning your site into a solution that can be made portable across the organization.
Top of Page
Saving a site as a template
You can save a site as a template at any time using the template option (Save site as template) on the Site Settings page in SharePoint. SharePoint Designer 2010 makes it easy by providing a Save as Template option in the ribbon, which takes you to this page in SharePoint. Once you save the template, a solution file is created and stored in the Solution Gallery where you can download or activate the solution.
To save your site as a template using SharePoint Designer 2010, perform the following steps:
- Open your site in SharePoint Designer 2010.
- On the Site tab, in the Manage group, click Save as Template.
- This takes you to the Save as Template page in SharePoint.
- Specify a name to use for the template file in the File name field.
- Specify a name and description for the template in the Template name and Template description fields.
- To include the content of the site in the site template, check the Include Content box.
Note Including the content of the site can increase the size of the template significantly. Keep in mind that the default size limit for a site template is 50 MB but may be less in your organization.
- Click OK to save the template.
- If all of the components on the site are valid, the template is built, and you see a message that says Operation Completed Successfully.
- To download or activate the solution from the solution gallery, click the user solution gallery link and follow the steps in the procedure below.
- Or, to return to your site, click OK.
Top of Page
Activating the site template in the solution gallery
Once you’ve saved your site as a template, a solution file (.wsp) is created and stored in the Solution Gallery for the site collection. From here, you can download or activate the solution.
To activate your site template, perform the following steps:
- Browse to the top level site of your site collection in SharePoint.
- Click Site Actions and choose Site Settings.
- Under Galleries, click Solutions.
- To activate your solution, click the pull-down menu beside your solution, and choose Activate.
- On the activate solution confirmation screen, click Activate.
Your solution now has an activated status in the Solution Gallery.
- To download the solution, just click its name in the Solution Gallery.
- In the File Download dialog box, click Save, and browse to the location where you want to save the solution.
Top of Page
With your solution uploaded and activated in the Solution Gallery, users will see it as an available template on the Create site page in SharePoint. You can select it and create a new site from it, which will inherit the components of the site, its structure, workflows, and more. Or, you can download your solution from the Solution Gallery and deploy it in another SharePoint environment or open it up in Microsoft Visual Studio, which also supports WSPs.
The site template option in SharePoint Designer 2010 makes all of this possible. Learn more about WSPs in the See Also section.
Top of Page