Using the Central Template Gallery

The Partner Portal application uses a site template when it creates an incident site in a partner's site collection. Each partner's site collection must access the incident site template to create the site. Site templates that must be globally accessible are installed in the central template gallery (this is sometimes named the global template gallery). The template title must be unique within the central template gallery. The only way to add a template to the gallery is with the STSADM addtemplate command or with the SharePoint object model. For more information, seeCustom Site Templates on MSDN.

The following STSADM example shows how to add an incident site template to the central site template gallery:

stsadm -o addtemplate -filename "incidentsubsite.stp" -title "SPGSubsiteTemplate" -description "SPG Sub Site Template "

To modify the template in the central site template gallery, delete the original template and replace it with the updated version. If you want to retain the original template and also add an updated template, you must provide a unique title and file name for the updated template when you add the new version.

The following STSADM example shows how to add a second version of the original template as a new template in the central site template gallery:

stsadm -o addtemplate -filename "incidentsubsiteV2.stp" -title "SPGSubsiteTemplateV2" -description "SPG Sub Site Template V2"

This example adds the updated version to the gallery as a new template. Notice that both the name and title differ from the original template. This approach leaves both the original and new template available for use.

Viewing the Gallery Contents

There are two ways to view the template gallery to discover the global site templates that are available. You can either use the browser or you can use the STSADM Enumtemplates command.

To use the browser, navigate to the root of your site collection. Click the Site Actions drop-down box, and then click Create Site in the drop-down list. In the template selection area, a Custom tab will be visible if there are any custom templates installed in the gallery. Click Custom to display the list of available templates. Only the titles of the templates appear in the list. The following illustration shows an example.

Template selection area

Ff647616.d0d3d3f8-14f5-4e66-8e1b-4348239f285c(en-us,PandP.10).png

The Enumtemplates command can also be used to list the templates to the gallery. The following STSADM example shows how to do this:

stsadm -o enumtemplates

The following is a sample result:

SPGSubsiteTemplate - Language: 1033 - Site Template: _GLOBAL_#0 - Template Id: 1
SPGSubsiteTemplateV2 - Language: 1033 - Site Template: _GLOBAL_#1 - Template Id: 1
MyOtherSiteTemp - Language: 1033 - Site Template: _GLOBAL_#2 - Template Id: 1

The Enumtemplates command provides more information than the browser. It includes the language, where 1033 is American English, a global identifier that SharePoint uses, and the template ID.

If you use the Addtemplate command, you must update any references in your code to point to the updated template with the new name. Microsoft Office SharePoint Services does not recognize the updated template as a replacement for the original template.

An alternative to renaming the updated template is to first delete the original template and then add the updated template. The following STSADM example shows how to do this.

stsadm -o deletetemplate -title SPGSubsiteTemplate
stsadm -o addtemplate -filename "incidentsubsite.stp" -title "SPGSubsiteTemplate" -description "SPG Sub Site Template"

The first STSADM command deletes the site template with the title SPGSubsiteTemplate. The second command adds the updated version of the template. Because the file name and title are the same as the original template, there is no need to update the references to the template.

Mapping a Business Event to a Site Template or Site Definition

The Partner Portal application uses a service that automates the creation of collaboration sites. The service is triggered by two business events. One event is when there is a support incident, and the other event is when there is an order exception. There is a mapping between the business event and a site template. You can use the browser to change the mapping between a site and a template. The following procedure describes how to do this.

To map a site to a global template

  1. Navigate to the root page of the site collection.
  2. Under Lists, select the site template mapping list.
  3. Select the list item whose template you want to change, and then click Edit Item.
  4. Enter the name of the new site template in the Site Template box.
  5. Click OK.

As an example, the following procedure describes how to change the site template that is used when an incident management site is created. This example assumes that you have an updated template to replace the original template.

To change the site template

  1. Go to Partner Central, click Sites on the Quick Launch , and then click SPGSubsite.
  2. On the Quick Launch menu, click Business Event Type Configuration.
  3. Click Incident.
  4. Click Edit Item.
  5. Enter the name of the new template in the Site Template box.

More Information

For information about how an incident subsite is created, see Workflow-Driven Site Creation.

For information about custom site templates and the template gallery, see Custom Site Templates on MSDN.

Home page on MSDN | Community site