Saturday, March 26, 2005

Branding a SharePoint Site

When deploying a professional SharePoint site on the web or an intranet, you (or your client) mostly want to change the look and feel of the site. This process is called branding.

The first thing you have to understand is the way a web page is rendered.
Microsoft provides some site definitions out of the box.

A site definition is nothing more than a couple of files that are in C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\\ on the server. Each folder in the above path is a site definition (except for the XML folder).



The contents of a site definition folder

When you request a page in your browser, IIS grabs the file from this folder and fills it with content out of the content database.
So when you modify these files, all pages of your site and all its subsites (created with the same template) will have the changes you made. We refer to these pages as 'ghosted' pages.
When you make your changes in FrontPage however, the page, including your changes, is stored in the content database. Now when you request the page, it is only grabbed from the database. None of the other pages or sites will have the changes you made to this page. We refer to these pages as 'unghosted' pages.

When you want to create your own site definition, be aware to make your changes in a copy of an existing folder (eg, copy STS and name it for example ACTIONCOMMITTEE). When you install an update of SharePoint, it's possible that the uodate overwrites this folder, resulting in a loss of your changes. And you don't want that to happen, do you?. So work with a copy. Your copy should be in capital letters.

After you made your own template, you have to let SharePoint know that it can use it.
To do so, you have to make a copy of the C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033\XML\WEBTEMP.XML file. Rename your copy to WEBTEMP*.XML (type whatever you want instead of the *).
Each WEBTEMP.XML file contains a collection of Template elements and Configuration subelements, which identify to the compiler all the site definitions that can be instantiated. In each Template element defined in the WEBTEMP.XML file, the Name attribute must contain the same name, in all capital letters, that is assigned to the new folder. Also, in order to avoid conflict with IDs already used in Windows SharePoint Services, use unique values greater than 10,000 for the ID attribute.

Save all your files and reset IIS.
Now when you create a new site, your customized template will be available in the template list.

Also check out these MSDN articles on how to brand your SPS sites:
Introduction to Templates and Definitions
Creating a Site Definition from an Existing Site Definition
Customizing SharePoint Sites and Portals, Part 1
Customizing SharePoint Sites and Portals, Part 2: Using Templates and Site Definitions
Customizing SharePoint Sites and Portals, Part 3: Style Sheet Class Reference Tables
Branding a SharePoint Portal Server 2003 Site, Part 1: Understanding the Use of a Corporate Brand
Branding a SharePoint Portal Server 2003 Site, Part 2: How to Apply Your Own Corporate Brand