Compartilhar via


Deciding Between Custom Web Templates and Custom Site Definitions

Applies to: SharePoint Foundation 2010

We recommend that you construct Microsoft SharePoint Foundation solutions as one or more features, possibly including one or more Web Parts, whenever possible instead of creating a custom site definition or custom web template. Doing this maximizes flexibility both for you as a developer and for your users.

However, if a custom site type makes the most sense for your solution, the next question is whether to create a web template or a site definition. To maximize the chances that your solution will be compatible with future versions of SharePoint Foundation, we recommend that you create a web template. Some other advantages of web templates are the following.

  • Custom web templates are easy to create.

  • Almost anything that can be done in the user interface can be preserved in the template.

  • Custom web templates can be modified without affecting existing sites that have been created from the templates.

  • Custom web templates are easy to deploy.

  • The user context in which a web template is deployed does not have to have access to the file system of the servers.

However, in the following scenarios (which are not common), you must create a custom site definition.

  • The custom site type requires new document template for document libraries. (But note that the recommended way to add a new document type is to create a custom content type instead of a new document template in a site definition. For more information, see the Content Types node of this SDK.)

  • The custom site requires a custom email footer.

  • The custom site type requires a custom "component" of the type itemized in the Components element of an onet.xml file, such as a custom file dialog post processor or a custom external security provider.

See Also

Tasks

How to: Create a Custom Web Template

How to: Create a Custom Site Definition and Configuration

Concepts

Site Types: WebTemplates and Site Definitions