Microsoft SharePoint Products and Technologies Administrators Pocket Consultant

Building on the default site templates, you can create custom site templates by saving a modified site as a site template. This functionality means that, whenever you modify a site, you are creating the basis of a custom site template. These custom templates are basically macros that contain any changes from the native templates.

Modifying the Common Look And Feel

As the name suggests, the Look And Feel settings control appearance and user interactions across the site as a whole. To modify the look and feel of a site, browse to Site Actions > Site Settings, as shown in Figure 5-2. On entering site settings, you find the options shown in Figure 5-3 under Look And Feel.

Figure 5-2: The Site Actions menu is available only to users with elevated permissions.

Figure 5-3: The Look And Feel settings contain basic customization options.

Title, Description, and Icon

The title, description, and icon page allows you to change settings that were originally defined during site creation.

Tree View

The Tree View is a very useful navigation tool, but can take up significant page space. For this reason, use it sparingly.

Site Theme

Themes alter the visual elements of a site, such as colors and fonts, but do not alter the site's content, layout, or functionality. Select the desired theme from the drop-down list and click Apply. Site theme settings do not propagate to child sites and are not automatically applied to subsequently created child sites. To create a consistent look and feel across the site collection, you must apply the theme to each site.

Top Link Bar

The Top Link Bar provides a place that is highly visible to all users and can link to any number of sites. You can use it to provide links to SharePoint sites or external URLs.

Important 

If you activate the Publishing Infrastructure feature, Top Link Bar and Quick Launch functionality are transferred to the newly created Site Navigation settings object in Look And Feel.

Quick Launch

The Quick Launch provides another navigation option for site collection administrators to expose content and links. Add items to the Quick Launch sparingly, as having too many items reduces its effectiveness.

Tip 

To enable or disable the Quick Launch, use the Tree View interface.

Saving a Site as a Template

To create a custom template, browse to Site Actions > Site Settings > Look And Feel > Save Site As Template. Give the new template a file name, template name, and description. Use meaningful values for all three properties, and be specific with descriptions. Using a consistent naming convention and thorough descriptions makes future reuse much easier.

Caution 

Site templates can contain sensitive information, such as farm URLs and account names. Be certain of what information you are saving within a template and only share templates with trustworthy groups.

When saving a site as a template you can elect to save the site's content along with the site. Doing so saves all of the site's libraries and lists within the site's template, which increases the amount of storage space required for the template. Remember that the maximum size for a template, whether it is a site or list template, is 10 MB. Some customizations, such as workflows, cannot be saved within a template if Include Content is selected. After the site template is created, it is available when creating new sites within the site collection and can be viewed by browsing to Site Actions > Site Settings > Galleries > Site Templates.

Resetting a Site

If you no longer want the customizations that are applied to a site, you can reset the site to its original definition. Resetting the site removes only the customizations added to the site and its Web Parts; it resets the site to the default template, as if it had been freshly installed. Browse to Actions > Site Settings > Look And Feel > Reset Site To Definition. To reset a specific page within the site, enter the page's URL in the Local URL For The Page text box. To reset all the pages within the collection, select the Reset All Pages In This Site To Site Definition Version option button.

Tip 

If you use SharePoint Designer 2007 to reset a site, a backup copy of the site is created automatically before the site is reset.

Managing the Site Template Gallery

The Site Template Gallery serves as a central repository of custom site templates for an entire site collection. Sites saved as templates are added to the site template gallery of the collection to which they belong. Sites within the gallery can be exported for use in other site collections. Likewise, sites from other site collections can be imported into the site template gallery. To manage the Site Gallery, browse, from the top level of the site collection, to Site Actions > Galleries > Site Templates, as shown in Figure 5-4.

Figure 5-4: Choose Site Templates from the Galleries settings.

Exporting a Site Template

Within the site template gallery, click on the name of the site template you wish to export and use the Save As dialog box to save the template file. Take care when exporting to a different farm. The Site Template on which the custom template was based, which is also called a site definition, must exist on all servers in the target farm or the template will fail.

Adding a Site Template

Within the site template gallery, select Upload Document from the Upload drop-down list. Enter a URL in the name text box, or click Browse to select a file to add to the gallery. The site definition must exist on the Web front-end server, or the site will not function. After clicking OK you are taken to the template's edit page.

Tip 

If you need to add the same template to more than one site collection, consider adding the template to the Central Template Gallery.

Editing and Deleting Site Templates

Clicking the Edit icon of a template in the template gallery allows you to change the template's name, title, and description, as shown in Figure 5-5. You may also Delete or Check In/Out the template.

Figure 5-5: The Edit icon in the template gallery is similar to the icon used in the Web Parts gallery.

Managing the Central Template Gallery

In an environment with many site collections, adding a template to each collection is both a tedious and error-prone process. As the number of collections increases, it becomes progressively more likely that you may overlook a collection. Fortunately, a central repository is maintained that provides templates to all the sites in a farm.

Listing the Templates in the Central Gallery

To view all of the templates contained in the Central Gallery, use the command:

stsadm.exe -o enumtemplates [-lcid <language>]

Adding a Template to the Central Gallery

To ensure that the template is available across site collections you can use the Stsadm.exe command with the syntax:

stsadm -o addtemplate -filename<template filename> -title <template title> [-description <template description>]

The description parameter is optional.

Note 

If a template exists with the same title as the template that is being added, it must be deleted before the addition of the new template will succeed.

Deleting a Template from the Central Gallery

When a template no longer needs to be available to all site collections or it must be removed to make room for a newer template, it can be deleted using Stsadm.exe as follows:

stsadm.exe -o deletetemaplate -title <template title> [-lcid <language>]

Important 

Sites that are already provisioned using the template are not affected by deleting the template. Likewise, existing sites are not affected by replacing an existing template with another template of the same title. Deletion of the site definition in the 12 Hive, however, does disable all site templates based off that site definition.

Категории