- Business logic
- application development
- Visual C#
- Visual Studio
- Microsoft Office
- Exchange server
- SharePoint 2010
- document management
- Web development
- Web sites
- Web Parts
- SharePoint Service Account
- SharePoint administration
Working with Templates in SharePoint
This article covers templates in SharePoint and how you can work with them to create custom templates that you can use across sub-areas. If you plan to follow along, before you begin, it's a good idea to create a sub-site under your SharePoint main site. If you're not sure how to do that, you can find detailed instructions in my previous SharePointBriefing article, "Working with Lists in SharePoint."
Templates in SharePoint
Templates in SharePoint are pre-defined layouts that you can use to customize the look and feel of your sites. There are two types of templates in SharePoint—list templates and site templates. You'll see more information about both types in this article.
SharePoint ships with a list of pre-defined templates, which include:
- SharePoint Portal Server My Site
- SharePoint Portal Server Site
- SharePoint Portal Server Personal Space
- Contents area Template
- Topic area template
- News area template
- News Home area template
- Windows SharePoint Services Site
- Site Directory area template
- SharePoint Portal Server Web Template
- Community area template
You can find those templates in the
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033 folder.
Figure 1. Creating a Site Template: From Central Administration, clicking Site Settings → Save site as template, gets you to this template definition dialog.
All members of the Administrator site group for a particular site can create either site or list templates based on that site. SharePoint stores custom site templates in the database; they serve as a model for building other sites based on them, so they're perfect for reusing sites layouts.
In contrast, list templates are actually a part of site templates. SharePoint stores these in the site collection template gallery. A list template defines a layout and the basic information about a list, such as the columns and fields used in the list, available views for the list, and the look and feel of the list. Optionally, they can also contain content. MSDN states, "Site templates contain the same type of data as list templates, but site templates include data for the entire site. Like list templates, site templates may also include the content of the site."
Creating Site Templates
Site templates store the structure and (optionally) the content of sites so you can reuse that structure and/or content for other sites.
Figure 2. Site Template Created: You'll see this screen when you have successfully defined a new template.
To create a new Site Template, follow these steps.
- From Central Administration, find the site that you created earlier, and click on Site Settings.
- Under Look and Feel, click on the "Save site as template" link (see Figure 1).
- Type the filename for the new site template file in the "File name" field.
- Specify the title you want for this template in the "Template name" field.
- Type a description (optional) for the site template.
- Select the "Include content" check box if you want the new template to use the existing site content.
- Click OK
If all goes well, SharePoint will save the new template to the site template gallery (see Figure 2). You can now create sites based on this template.
TAGS:Web sites, Microsoft, SharePoint, portal
A Developer.com eBook
Discover how to start developing for the Android platform with this extensive guide, which provides a reference to the Android platform as well as a look at developing your first Android application. You'll explore the top 10 features for developers as well as learn design and development tips that go beyond the phone and target tablet development as well.