Saturday 11 July 2015

Site Template

Understanding a site template

Before you work with a site template, it’s helpful to understand what a site template is in more detail so you can use it more effectively. This section discusses the following:
Top of Page

What is a site template?

You're probably familiar with the default site templates, such as Team Site, Project Site, and Communities Site. SharePoint site templates are prebuilt 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 want. For more information, see What kinds of sites can I create in SharePoint and Office 365?
In addition to these default site templates, you can also create your own site template based on a site you've created and customized. A custom site template is a way to package site features and customizations that you can add to a solutions gallery. Custom site templates are often used to deploy solutions in other sites or to provide site consistency within your organization. For example, you may have a standard policy on project management, and so you require the use of a custom project site template for all new projects.
A custom site template is a powerful feature that allows you to create a solution and then share that solution with your peers, the broader organization, or outside organizations. You can also package the site into a Web Solution Package file (.wsp) and open it in another environment or application such as Visual Studio and further customize it there. Turning your customized site or business solution into a template is an extremely useful and very powerful capability. Once you start to package your solution as a template, you begin to realize the potential of SharePoint as a platform for business applications. Site templates make all of this possible.
Top of Page

What gets saved in a site template?

When you save a 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 also include the contents of the site in the template; for example, the documents stored in the document libraries or data in the lists. This could be useful to provide sample content for users to get started with. But consider that including content could also increase the size of your template beyond the 50 MB site template limit.
Most of the features in a site are included and supported by the template. However, there are several features that are not supported.
  • Supported    Lists, libraries, external lists, data source connections, list views and data views, custom forms, workflows, content types, custom actions, navigation, site pages, master pages, modules, and web templates.
  • Unsupported    Customized permissions, running workflow instances, list item version history, workflow tasks associated with running workflows, people or group field values, taxonomy field values, publishing sites and pages, and stapled features.
When you create a site template, information about site features and content types is also saved. When you use the site template in a different site collection, those features must be available and activated for the site template to work. Problems can arise when moving site templates from SharePoint Server on premise to SharePoint online. Certain features and content types may not even be available depending on the SKU and configuration.
Note    Moving site templates between different versions, such as SharePoint 2010 to SharePoint 2013, is not supported.
Top of Page

What can you do with a site template?

Saving a site as a template is a powerful feature because it offers so many uses of custom sites. Here are the immediate benefits you get from saving a site as a template:
  • Deploy solutions immediately    Save and activate the template in the solutions gallery and let other employees create new sites from this template. They can select it, and then create a new site from it, which will inherit the components of the site, its structure, workflows, and more. In short, just save the site as a template, activate it, and off you go.
  • Portability    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.
  • Extensibility    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. As a result, site development can go through a solution life cycle (develop, stage, and put into production).
As you begin to create 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

Work with a site template

The basic steps to working with a site template are as follows:
Top of Page

Save a site template to the Solutions Gallery

When you save a site template, you create a Web Solution Package file (.wsp) is that is stored in the Solutions Gallery for further use. Only the current site is saved; not any subsites below the site.
  1. Navigate to the top-level site of your site collection.
  2. Click Settings SharePoint Online Public Website Settings button and then click Site Settings.
  3. In the Site Actions section, click Save site as a template.
  4. Specify a name to use for the template file in the File name box.
  5. Specify a name and description for the template in the Template name and Template description boxes.
  6. To include the content of the site in the site template, select the Include Content check box. The limit is 50 MB and cannot be changed.

    Important    Before creating a site template that includes content, check the workflow history list for the site. If there are thousands of items in the list, it may take a long time to create the site template or you may exceed the limit of 50 MB. In this case, it’s a good idea to modify the workflow association to a use new workflow history list and then delete the original workflow history list before creating the site template.
  7. Click OK to save the template.
    If all of the components on the site are valid, the template is created, and you see a message that states "Operation Completed Successfully."
  8. Do one of the following:
    • To return to your site, click OK.
    • To go directly to the site template, click Solutions Gallery.
Top of Page

Download the site template from the Solutions Gallery

When you download your site template, you create a .wsp file that is portable and easy to use in other site collections.
  1. Navigate to the top-level site of your site collection.
  2. Click Settings SharePoint Online Public Website Settings button and then click Site Settings.
  3. In the Web Designer Galleries section, click Solutions.
  4. If it's necessary to activate the solution, select it, and in the Commands group, click Activate. Then, on the Activate Solution Confirmation screen, in the Commands group, click Activate.
  5. Click its name in the solutions gallery, and click Save.
  6. In the Save As dialog box, browse to the location where you want to save the solution, click Save, and then click Close.
Top of Page

Upload the site template to a Solutions Gallery

You can upload a .wsp file to the same site collection or different site collections in the same or different SharePoint environments.
  1. Navigate to the top-level site of your site collection.
  2. Click Settings SharePoint Online Public Website Settings button and then click Site Settings.
  3. In the Web Designer Galleries section, click Solutions.
  4. In the Commands group, click Upload, and then in the Add a Document dialog box, click Browse.
  5. In the Choose File to Upload dialog box, locate the file, select it, click Open, and then click OK.
  6. To activate the solution, on the Activate Solution confirmation screen, in the Commands group, click Activate.
Top of Page

Create a site from the site template

After you create a site template and confirm it is activated, you can create a site based on the template. The next time that you create a site or subsite, the template is available for selection in the Custom tab of the Template Selection section on the New SharePoint Site page.
  1. Click Site Actions and then New Site.
  2. Click Browse All. Alternately, click Site Actions, View All Site Content, and click Create. You can filter the dialog by Site.
  3. Scroll to the bottom of all listed templates.
  4. Find and select your template.
  5. Enter a Title and a URL name for the new site in the right-hand panel of the screen.
Note    Click the More Options button to expand the options you see in the Create dialog box by default. Along with setting specific navigation options, you can specify if the site inherits its permissions Groups from the parent site (Use same permissions as parent site) or not (Use unique permissions). If you choose the former, you will inherit the permissions Groups of the site collection in the hierarchy above the site you’re about to create. If you choose the latter, you will have new Groups without users and can assign unique permissions.
Top of Page

Manage the Solutions Gallery

You can control when a site template appears in the Create dialog box or its resource usage by activating and deactivating site templates in the Solution Gallery.
  1. Navigate to your Solution Gallery.
  2. Click Settings SharePoint Online Public Website Settings button , Site Settings, and, then under the Galleries section, click Solutions.
  3. Select a site template, and then do one of the following:
    • Activate    Makes the site template available for use when users create new sites through the Create dialog.
    • Deactivate    Removes the site template from the Create dialog box. A deactivated site template is unavailable for site creation and can be deleted.
    • Delete    Removes the site template from the Solution Gallery, but moves it into to the Recycle Bin for 90 days by default before the Recycle bin is emptied. This is helpful if you later decide to restore it. If you need to delete a site template, you must deactivate it first.
      Note  
  4. It is important to monitor the growth of the Solutions Gallery. Each entry has a resource usage number assigned to it. Solutions can consume resources, and for that reason they may be temporarily disabled if resource usage exceeds quota.
  5. If you upload a site template to a Solutions Gallery, and the original site template is currently deactivated, you can potentially overwrite the original site template. To avoid this, make sure to uniquely name the site template you are uploading. However, you will not be able to activate both solutions at the same time, and will need to deactivate the original if you wish to use the newly uploaded site template for site creation.
Top of Page

No comments:

Post a Comment