In this post we will discuss some of the major differences between site definition and site template in SharePoint 2010.
Also you can check out:
A site definition defines a unique SharePoint site. Site definition is a combination of multiple files like .xml, .aspx, .ascx, and .master page, .gif , .doc etc and are stored in C:\ProgramFiles\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\SiteTemplates directory.
But Site Templates are created from an existing site and are stored in Content database in the Sandboxed Solution gallery.
According to MSDN
, Here are some advantages and disadvantages of Site Definition and Site template.
Advantages of Site Definitions:
- Data is stored directly on the Web servers, so performance is typically better.
- A higher level of list customization is possible through direct editing of a SCHEMA.XML file.
- Certain kinds of customization to sites or lists require use of site definitions
, such as introducing new file types, defining view styles, or modifying the drop-down Edit menu.
DisAdvantages of Site Definitions:
- Customization of site definition requires more effort than creating custom templates.
- It is difficult to edit a site definition after it has been deployed.
- Doing anything other than adding code can break existing sites.
- Users cannot apply a SharePoint theme through a site definition.
- Users cannot create two lists of the same type with different default content.
- Customizing site definitions requires access to the file system of the front-end Web server.
Advantages of Site Template:
- Custom templates are easy to create.
- Almost anything that can be done in the user interface can be preserved in the template.
- Custom templates can be modified without affecting existing sites that have been created from the templates.
- Custom templates are easy to deploy.
DisAdvantages of Site Template:
- Custom templates are not created in a development environment.
- They are less efficient in large-scale environments.
- If the site definition on which the custom template is based does not exist on the front-end server or servers, the custom template will not work.
Another difference is Feature Stapling is supported by Site Definitions but it is not supported by Site Template.