Creating and Using Site Templates

One of the biggest advantages of SharePoint over other web tools is how easy it is to duplicate your work using site templates. Once you get a project or department site set up the way you want it, you can simply save the site as a template and then create other similar sites based on that template.

There are two types of site templates in SharePoint:

  • Built-in templates are stored on the server as site definitions. These come with SharePoint and are sometimes provided by add-on vendors.

  • Custom templates are stored in the database as template files (.stp). You create these from existing sites.

Site definitions are collections of XML and ASPX files stored in folders at this location on the server:

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\Site Templates

Site definitions are complex, difficult to create, and almost impossible to debug. In contrast, custom templates are simple, easy to create, and don't need debugging. So why worry about site definitions? For the most part you shouldn't, but it helps to understand three things:

  • Custom templates are based on site definitions. In order for a custom template to work, the underlying site definition must be installed on the server.

  • Changes to site definitions propagate to all the sites that are based on them. In practice, changing a site definition in a live environment risks breaking sites, but minor changes can be OK.

  • Changes to custom templates don't change the sites that ...

Get Essential SharePoint 2007, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.