Tuesday, December 9, 2008

Site Templates in Sharepoint

Site Templates

Site templates are used to allow the rapid creation of web sites and basic content in a SharePoint system. Any number of new sites can be generated based on a site template, which is a set of basic content pages and schemas (which are themselves stored on the Web server as a set of HTML and XML files). There can be an unlimited number of site templates, although typically there are basic types and a few templates customized to an organization’s specific requirements.
A site template provides the basic components and layout of a new site created under SharePoint. A site template contains specific design information about a site, including the lists that are part of that site, Web Part Pages used in the site, the site’s themes and borders, changes to the Quick Launch bar, as well as some site content (such as document libraries).
A site template creates a copy of the template contents in the new site’s directory location. These template-created sites can still be modified, but a lot of the basic formatting of the site, as well as the site flow and logic, can be created quickly using a template instead of requiring manual coding.

Where are site templates kept?

When SharePoint Services is installed on a Web server, a default set of site definitions (including site templates and list templates) is created. Customized versions of an existing site definition can be created, modifying one of the existing sites to more closely suit specific requirements. Typically, new site definitions are made by copying an existing site definition, and then editing that copy. Modifying the default site templates is not recommended.
Site templates are stored in the SharePoint database and can be accessed through template galleries. Once a site template has been created, other users can use that template (or create copies of it for further modification). User-created site templates can be imported to the site collection level, adding them to the site template gallery. Site template files have an “.stp” extension.

Creating a Site Template

To create a site template, the Add Items right must be granted to the user for the site collection gallery. By default, this exists for the Designer and Administrator site groups, but any group can be given this right by an Administrator. To create a site based on a site template, the site definition must be available either on the server or in the SharePoint central template gallery.
To create a new site template, follow these steps:
  1. Click on Site Settings
  2. Under the Administration option, click on Go to Site Administration:

siteadminclick
  1. Under Management and Statistics, click on Save site as a template
saveastemplate
  1. When prompted, enter the name of the site template file. In the Template title field, enter the title of the site template as it will appear in the gallery (a descriptive title works best)
savetemplateinfo
  1. To include any existing site content, click the Include content check box
  2. Click OK
The new site template is added to the site gallery:
sitegallery
Clicking on the template name will initiate the process of creating a new site based on this site template.

Adding a Site Template to the Site Template Gallery

When a site template is created, it is automatically added to the site template gallery. If you are copying site templates from another location as a “.stp” file, you must manually add the site template to the gallery.
To add a site template to the site collection template gallery using the “.stp” file, follow these steps:
  1. From the top-level Web site, click on Site Settings
  2. Under the Administration link, click on Go to Site Administration
  3. Under Site Collection Galleries, click Manage site template gallery

managesites
  1. Click Upload Template

importtemplate
  1. Browse to the site template file, or enter the path and name of the file directly. You can upload several site templates at once by clicking on Upload Multiple Files.
uploaddialog
  1. Click Save
The new file templates will now be included in the site gallery.

Deleting a site template

To remove a site template from the site template gallery, follow these steps:
  1. From the top-level Web site, click on Site Settings
  2. Under the Administration link, click on Go to Site Administration
  3. Under Site Collection Galleries, click Manage site template gallery
  4. Click the Edit icon next to the site template you want to delete
editsite
  1. Click the Delete button
deletesite
The site template will be removed from the gallery, although the “.stp” file will not be deleted.

Editing a site template

To edit a site template name or description in the site template gallery, follow these steps:
  1. From the top-level Web site, click on Site Settings
  2. Under the Administration link, click on Go to Site Administration
  3. Under Site Collection Galleries, click Manage site template gallery
  4. Click the Edit icon next to the site template you want to change
  5. Make any changes and click the Save button


Print this post

No comments: