Guidelines for Templates and Definitions
To customize site definitions on front-end Web servers, it is required that you create a copy of one of the existing site definition directories and create a site definition as described in Creating a Site Definition from an Existing Site Definition. Changes that you make within originally installed files may be overwritten when you install updates or services packs for Windows SharePoint Services, or when you upgrade an installation to the next product version.
Changing a site definition after it has already been deployed can break existing sites and is not supported. If you find that you must modify a site definition after it has already been deployed, keep in mind that adding features can cause fewer problems than changing or deleting them. Changing features often results in loss of data and deleting them often results in broken views.
For backup/restore and migration operations, you must restore your site to a server that has the same front-end customizations as the server that you backed up or migrated from.
Customizing a site definition often requires that you reset, or stop and restart, Internet Information Services (IIS) before changes take effect.
Always test custom site or list definitions before deploying them.
Modifying site definition files to customize already existing sites or lists is not supported. A rule of thumb is to use site definitions to modify sites that will be created, but use the object model to modify sites after they are created.
Files not located under a site definition folder (for example, STS or MPS) are global to a Windows SharePoint Services deployment. Changing files within the Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LCID directory will affect the entire language-specific installation of Windows SharePoint Services, and changing files within the Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\XML folder will affect the entire deployment of Windows SharePoint Services on the front-end Web server.
When modifying site definitions, keep in mind that the contents of pages customized in Microsoft Office FrontPage 2003 are stored in the database. If you modify, or unghost, a page in FrontPage, changes that you later make to the definition may not affect the page. For more information on ghosting, see Introduction to Templates and Definitions.
File Name Restrictions
For security reasons, Microsoft Windows SharePoint Services only reads files in the Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\Template directory tree if their names are composed of ASCII letters, numbers, periods, underscores, or dashes. In addition, file names cannot contain two or more consecutive periods. For example, the following are legal file names:
- File Name With Spaces.avi
Advanced Site Definition Features
CAML provides various elements and attributes that can be used to make advanced customizations of site definitions, which are described in the following tables.
|ExecuteUrl||Specify a page to open immediately after site creation.|
|ExternalSecurityProvider||Implement a custom security provider.|
|FileDialogPostProcessor||Customize the Open or Save dialog box (File menu) used in document libraries.|
Attributes of the Project Element
|AlternateCSS||Add or modify CSS definitions.|
|AlternateHeader||Replace the top navigation area in site pages.|
|DisableWebDesignFeatures||Disable features on a site (for example, Backup, Subsite Creation, and so forth.)|
Customizing CSS Style Definitions
You can customize CSS style definitions by creating a .css file with a unique name in Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LAYOUTS\LCID\STYLES. Copy into this new file the contents of the default .css file specified within .aspx pages of the site definition, and add or update styles in the new .css file. Use the AlternateCSS attribute to specify the path to the new .css file, such as follows:
AlternateCSS = "/_layouts/[%=System.Threading.Thread.CurrentThread.CurrentUICulture.LCID%]/styles/MyStyles.css">
When deploying a custom template, remember that the .stp file maintains a unique identifier in relation to the originally installed site definition from which the custom template is derived. This means that a custom template will not function unless the original site definition is present on the front-end Web server or servers.