SlideShare a Scribd company logo
1 of 18
Site Templates, Site Definitions, Feature Stapling Salaudeen Rajack	 Salaudeen.Rajack@gmail.com
Introduction There is always a common source of confusion among SharePoint developers on Site Definitions ,Site Templates, Feature Stapling This presentation is prepared to give clear idea about the Site Templates, Site Definitions, and feature stapling Table on Contents ,[object Object]
Pros & Cons
Site Definitions
Pros & Cons
Site Template Vs Site Definitions
Feature Stapling
Terminology
Advantages
Hello world Feature Stapler example,[object Object]
Site Template Pros You can modify a site template without affecting existing sites created by the template. Site templates, compared to site definitions, are easy to create and deploy. You can make all customizations through the user interface or SPD. Easy to create - Site templates are easy to create. The site template approach is easier, and just requires the use of the Web interface and occasionally Microsoft SharePoint Designer. No server touch -- Site templates don't require access to the server. Single file deployment -- Because everything you need is in the single STP file, you don't have to worry about putting the files in the correct directories or accidentally creating a conflict. major benefit is that the Page and List definition is read locally from the file system, not from Content Database.
Site Template Cons Because the template is just a rubber stamp, applied when you create the site and there is no further connectivity with the template, you can change the template at will.  However, your changes won't be reflected in the site. Existing sites will not get affected, if you make any change to the site template. The modification will only affect the new site. Because it is slow to store templates in and retrieve them from the database, site templates can result in slower performance. Doesn't support Publishing Features; No Feature Stapling  Site templates are basically black boxes where you have limited control over the way that they are working 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.  Typically, site templates are not as efficient as site definitions in a large-scale environment
Site Definition – What is that? Site Definitions : As the name implies, A Site definition is "core definition of a site”. combination of files that are placed in the 12 hive of WFE during installation of SharePoint.  Site definition files include .xml, .aspx, .ascx, and .master page files, as well as document template files (.dot, .htm, and so on), and content files (.gif, .doc, and so on). The site template package is stored as a CAB-based file that can be downloaded or uploaded to site collections by users with the appropriate rights. As before, site templates offer a measure of portability to SharePoint Applications.
Site Definition Pros efficient and recommended for a large-scale environment A major benefit is that the Page and List definition is read locally from the file system, not from Content Database. Site definitions typically perform better when cached on the file system instead of in the database. It's a full-fledged part of the SharePoint infrastructure, so almost anything is possible.  If you have to include a custom cascading style sheet (CSS), wire up JavaScript events, or change the overall appearance of the page, the best way to do so is through a site definition.  Leverages feature framework  It is easier to add additional functionality to site which are developed using a site definition They enable complex customizations to be migrated easily from one environment to another  Certain functionality, such as declarative content types, custom file types and list views, can only be achieved within a Site Definition
Site Definition Cons Existing sites will be affected if you make any changes on to the site definition. Site definitions by contrast require file system access to the SharePoint server, and the ability to reboot Microsoft Internet Information Services (IIS) for your development server. No debugging support -- It's easy to make a mistake in the sparsely documented landscape of site definitions.  Requires knowledge of the Site Definition schema and XML  Customization of site definition requires more effort than creating custom templates. Editing a site definition after it has been deployed is difficult. 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.
Core Schema Files for Site Definition Table describes prominent XML files that can be modified for a site definition and shows their locations in the file system.
Site Definition Vs Site Templates
Deciding Between Site Definitions and Custom Site Templates Compare the Pros/Cons of Site Template and Site Definition If you need to make only minor changes in the look of certain pages and add a few fields in particular lists, you should create a custom site template.  However, if you need to create new content types, add new Web Part definitions, and significantly restructure sites, you should create a custom site definition. Can you deploy changes to the front-end Web server? If you do not have access to the file system of the computers running Windows SharePoint Services, you have no choice but to create a custom site template. Custom site definitions hold the many advantages over custom site templates:

More Related Content

What's hot

[Jansen] Transforming your classic team sites into modern group connected tea...
[Jansen] Transforming your classic team sites into modern group connected tea...[Jansen] Transforming your classic team sites into modern group connected tea...
[Jansen] Transforming your classic team sites into modern group connected tea...European Collaboration Summit
 
Back to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel OlesonBack to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel OlesonJoel Oleson
 
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced TroubleshootingSharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced TroubleshootingJohn Calvert
 
Advanced SharePoint Server Concepts
Advanced SharePoint Server ConceptsAdvanced SharePoint Server Concepts
Advanced SharePoint Server ConceptsLearning SharePoint
 
Heavy Metal PowerPivot Remastered
Heavy Metal PowerPivot RemasteredHeavy Metal PowerPivot Remastered
Heavy Metal PowerPivot RemasteredJason Himmelstein
 
PowerShell for the Anxious ITPro
PowerShell for the Anxious ITProPowerShell for the Anxious ITPro
PowerShell for the Anxious ITProJason Himmelstein
 
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 AppsAn IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 AppsRandy Williams
 
John Burkholder: Disaster Recovery in SharePoint 2010
John Burkholder: Disaster Recovery in SharePoint 2010John Burkholder: Disaster Recovery in SharePoint 2010
John Burkholder: Disaster Recovery in SharePoint 2010SharePoint Saturday NY
 
New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0Dima Maleev
 
O365con14 - sharepoint 2013 and office 365 upgrade and migration
O365con14 - sharepoint 2013 and office 365 upgrade and migrationO365con14 - sharepoint 2013 and office 365 upgrade and migration
O365con14 - sharepoint 2013 and office 365 upgrade and migrationNCCOMMS
 
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSBest Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSguest7c2e070
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSPC Adriatics
 
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...SPTechCon
 
SharePoint 2013 for Administrators and IT Pro's
SharePoint 2013 for Administrators and IT Pro'sSharePoint 2013 for Administrators and IT Pro's
SharePoint 2013 for Administrators and IT Pro'sLearning SharePoint
 
Office Web Apps Server 2013
Office Web Apps Server 2013Office Web Apps Server 2013
Office Web Apps Server 2013SPC Adriatics
 
Getting Started with Oracle APEX
Getting Started with Oracle APEXGetting Started with Oracle APEX
Getting Started with Oracle APEXDataNext Solutions
 
SharePoint 2013 Hosted App Presentation by Roy Kim
SharePoint 2013 Hosted App Presentation by Roy KimSharePoint 2013 Hosted App Presentation by Roy Kim
SharePoint 2013 Hosted App Presentation by Roy KimRoy Kim
 

What's hot (20)

[Jansen] Transforming your classic team sites into modern group connected tea...
[Jansen] Transforming your classic team sites into modern group connected tea...[Jansen] Transforming your classic team sites into modern group connected tea...
[Jansen] Transforming your classic team sites into modern group connected tea...
 
Back to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel OlesonBack to the Basics: SharePoint Fundamentals by Joel Oleson
Back to the Basics: SharePoint Fundamentals by Joel Oleson
 
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced TroubleshootingSharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
SharePoint 2016 Adoption - Lessons Learned and Advanced Troubleshooting
 
Advanced SharePoint Server Concepts
Advanced SharePoint Server ConceptsAdvanced SharePoint Server Concepts
Advanced SharePoint Server Concepts
 
Heavy Metal PowerPivot Remastered
Heavy Metal PowerPivot RemasteredHeavy Metal PowerPivot Remastered
Heavy Metal PowerPivot Remastered
 
PowerShell for the Anxious ITPro
PowerShell for the Anxious ITProPowerShell for the Anxious ITPro
PowerShell for the Anxious ITPro
 
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 AppsAn IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
An IT Pro Guide to Deploying and Managing SharePoint 2013 Apps
 
John Burkholder: Disaster Recovery in SharePoint 2010
John Burkholder: Disaster Recovery in SharePoint 2010John Burkholder: Disaster Recovery in SharePoint 2010
John Burkholder: Disaster Recovery in SharePoint 2010
 
New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0
 
Microsoft Azure
Microsoft AzureMicrosoft Azure
Microsoft Azure
 
O365con14 - sharepoint 2013 and office 365 upgrade and migration
O365con14 - sharepoint 2013 and office 365 upgrade and migrationO365con14 - sharepoint 2013 and office 365 upgrade and migration
O365con14 - sharepoint 2013 and office 365 upgrade and migration
 
SharePoint Tools Concepts
SharePoint Tools ConceptsSharePoint Tools Concepts
SharePoint Tools Concepts
 
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUSBest Practices to SharePoint Architecture Fundamentals NZ & AUS
Best Practices to SharePoint Architecture Fundamentals NZ & AUS
 
SharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi VončinaSharePoint 2013 Performance Analysis - Robi Vončina
SharePoint 2013 Performance Analysis - Robi Vončina
 
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 4: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 
SharePoint Administration
SharePoint AdministrationSharePoint Administration
SharePoint Administration
 
SharePoint 2013 for Administrators and IT Pro's
SharePoint 2013 for Administrators and IT Pro'sSharePoint 2013 for Administrators and IT Pro's
SharePoint 2013 for Administrators and IT Pro's
 
Office Web Apps Server 2013
Office Web Apps Server 2013Office Web Apps Server 2013
Office Web Apps Server 2013
 
Getting Started with Oracle APEX
Getting Started with Oracle APEXGetting Started with Oracle APEX
Getting Started with Oracle APEX
 
SharePoint 2013 Hosted App Presentation by Roy Kim
SharePoint 2013 Hosted App Presentation by Roy KimSharePoint 2013 Hosted App Presentation by Roy Kim
SharePoint 2013 Hosted App Presentation by Roy Kim
 

Similar to SharePoint Site templates, site definitions, feature stapling

Schaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site DefinitionsSchaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site Definitionsmferraz
 
Blooming SharePoint Design
Blooming SharePoint DesignBlooming SharePoint Design
Blooming SharePoint DesignKathy Hughes
 
Sps redmond 2014 deck
Sps redmond 2014 deckSps redmond 2014 deck
Sps redmond 2014 deckDorinda Reyes
 
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007Chandima Kulathilake
 
SUG Bangalore - Overview of Sitecore Experience Accelerator with Pratik Satik...
SUG Bangalore - Overview of Sitecore Experience Accelerator with Pratik Satik...SUG Bangalore - Overview of Sitecore Experience Accelerator with Pratik Satik...
SUG Bangalore - Overview of Sitecore Experience Accelerator with Pratik Satik...Anindita Bhattacharya
 
Site Templates in SP 13
Site Templates in SP 13Site Templates in SP 13
Site Templates in SP 13Shahzad S
 
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBlog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateSean Burgess
 
Designing SharePoint 2010 for Business
Designing SharePoint 2010 for BusinessDesigning SharePoint 2010 for Business
Designing SharePoint 2010 for BusinessKanwal Khipple
 
The A to Z of Building a Responsive SharePoint Site with Bootstrap
The A to Z of Building a Responsive SharePoint Site with BootstrapThe A to Z of Building a Responsive SharePoint Site with Bootstrap
The A to Z of Building a Responsive SharePoint Site with BootstrapThomas Daly
 
SharePoint 2010 Introduction
SharePoint 2010 IntroductionSharePoint 2010 Introduction
SharePoint 2010 IntroductionVishal Gupta
 
Introduction to Branding SharePoint
Introduction to Branding SharePointIntroduction to Branding SharePoint
Introduction to Branding SharePointK.Mohamed Faizal
 
Branding SharePoint 2013
Branding SharePoint 2013Branding SharePoint 2013
Branding SharePoint 2013NIFTIT
 
SharePoint Development(Lesson 5)
SharePoint Development(Lesson 5)SharePoint Development(Lesson 5)
SharePoint Development(Lesson 5)MJ Ferdous
 
Branding share point 2013
Branding share point 2013Branding share point 2013
Branding share point 2013Khoa Quach
 
SharePoint Branding From Start to Finish
SharePoint Branding From Start to FinishSharePoint Branding From Start to Finish
SharePoint Branding From Start to FinishKanwal Khipple
 
Customizing IBM Connections 3.0 - LS11 AD304
Customizing IBM Connections 3.0 - LS11 AD304Customizing IBM Connections 3.0 - LS11 AD304
Customizing IBM Connections 3.0 - LS11 AD304malexanderIBM
 
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVPFeature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVPAyman El-Hattab
 
2013 SPFest - Customizing Sites and Pages in SharePoint 2013
2013 SPFest - Customizing Sites and Pages in SharePoint 20132013 SPFest - Customizing Sites and Pages in SharePoint 2013
2013 SPFest - Customizing Sites and Pages in SharePoint 2013Wes Preston
 
Iw411 migrating content by search from 2010 into 2013 - minified
Iw411   migrating content by search from 2010 into 2013 - minifiedIw411   migrating content by search from 2010 into 2013 - minified
Iw411 migrating content by search from 2010 into 2013 - minifiedPaul Hunt
 

Similar to SharePoint Site templates, site definitions, feature stapling (20)

Schaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site DefinitionsSchaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site Definitions
 
Blooming SharePoint Design
Blooming SharePoint DesignBlooming SharePoint Design
Blooming SharePoint Design
 
Sps redmond 2014 deck
Sps redmond 2014 deckSps redmond 2014 deck
Sps redmond 2014 deck
 
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
UX01 Customization Tour Of SharePoint - APAC Conference Sydney - 2007
 
SUG Bangalore - Overview of Sitecore Experience Accelerator with Pratik Satik...
SUG Bangalore - Overview of Sitecore Experience Accelerator with Pratik Satik...SUG Bangalore - Overview of Sitecore Experience Accelerator with Pratik Satik...
SUG Bangalore - Overview of Sitecore Experience Accelerator with Pratik Satik...
 
SXA in action
SXA in actionSXA in action
SXA in action
 
Site Templates in SP 13
Site Templates in SP 13Site Templates in SP 13
Site Templates in SP 13
 
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog TemplateBlog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
Blog It Up, Baby! Extending the new IBM Lotus Domino Blog Template
 
Designing SharePoint 2010 for Business
Designing SharePoint 2010 for BusinessDesigning SharePoint 2010 for Business
Designing SharePoint 2010 for Business
 
The A to Z of Building a Responsive SharePoint Site with Bootstrap
The A to Z of Building a Responsive SharePoint Site with BootstrapThe A to Z of Building a Responsive SharePoint Site with Bootstrap
The A to Z of Building a Responsive SharePoint Site with Bootstrap
 
SharePoint 2010 Introduction
SharePoint 2010 IntroductionSharePoint 2010 Introduction
SharePoint 2010 Introduction
 
Introduction to Branding SharePoint
Introduction to Branding SharePointIntroduction to Branding SharePoint
Introduction to Branding SharePoint
 
Branding SharePoint 2013
Branding SharePoint 2013Branding SharePoint 2013
Branding SharePoint 2013
 
SharePoint Development(Lesson 5)
SharePoint Development(Lesson 5)SharePoint Development(Lesson 5)
SharePoint Development(Lesson 5)
 
Branding share point 2013
Branding share point 2013Branding share point 2013
Branding share point 2013
 
SharePoint Branding From Start to Finish
SharePoint Branding From Start to FinishSharePoint Branding From Start to Finish
SharePoint Branding From Start to Finish
 
Customizing IBM Connections 3.0 - LS11 AD304
Customizing IBM Connections 3.0 - LS11 AD304Customizing IBM Connections 3.0 - LS11 AD304
Customizing IBM Connections 3.0 - LS11 AD304
 
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVPFeature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP
Feature and Solution Framework in SharePoint 2010, Ayman El-Hattab MVP
 
2013 SPFest - Customizing Sites and Pages in SharePoint 2013
2013 SPFest - Customizing Sites and Pages in SharePoint 20132013 SPFest - Customizing Sites and Pages in SharePoint 2013
2013 SPFest - Customizing Sites and Pages in SharePoint 2013
 
Iw411 migrating content by search from 2010 into 2013 - minified
Iw411   migrating content by search from 2010 into 2013 - minifiedIw411   migrating content by search from 2010 into 2013 - minified
Iw411 migrating content by search from 2010 into 2013 - minified
 

SharePoint Site templates, site definitions, feature stapling

  • 1. Site Templates, Site Definitions, Feature Stapling Salaudeen Rajack Salaudeen.Rajack@gmail.com
  • 2.
  • 6. Site Template Vs Site Definitions
  • 10.
  • 11. Site Template Pros You can modify a site template without affecting existing sites created by the template. Site templates, compared to site definitions, are easy to create and deploy. You can make all customizations through the user interface or SPD. Easy to create - Site templates are easy to create. The site template approach is easier, and just requires the use of the Web interface and occasionally Microsoft SharePoint Designer. No server touch -- Site templates don't require access to the server. Single file deployment -- Because everything you need is in the single STP file, you don't have to worry about putting the files in the correct directories or accidentally creating a conflict. major benefit is that the Page and List definition is read locally from the file system, not from Content Database.
  • 12. Site Template Cons Because the template is just a rubber stamp, applied when you create the site and there is no further connectivity with the template, you can change the template at will. However, your changes won't be reflected in the site. Existing sites will not get affected, if you make any change to the site template. The modification will only affect the new site. Because it is slow to store templates in and retrieve them from the database, site templates can result in slower performance. Doesn't support Publishing Features; No Feature Stapling Site templates are basically black boxes where you have limited control over the way that they are working 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. Typically, site templates are not as efficient as site definitions in a large-scale environment
  • 13. Site Definition – What is that? Site Definitions : As the name implies, A Site definition is "core definition of a site”. combination of files that are placed in the 12 hive of WFE during installation of SharePoint. Site definition files include .xml, .aspx, .ascx, and .master page files, as well as document template files (.dot, .htm, and so on), and content files (.gif, .doc, and so on). The site template package is stored as a CAB-based file that can be downloaded or uploaded to site collections by users with the appropriate rights. As before, site templates offer a measure of portability to SharePoint Applications.
  • 14. Site Definition Pros efficient and recommended for a large-scale environment A major benefit is that the Page and List definition is read locally from the file system, not from Content Database. Site definitions typically perform better when cached on the file system instead of in the database. It's a full-fledged part of the SharePoint infrastructure, so almost anything is possible. If you have to include a custom cascading style sheet (CSS), wire up JavaScript events, or change the overall appearance of the page, the best way to do so is through a site definition. Leverages feature framework It is easier to add additional functionality to site which are developed using a site definition They enable complex customizations to be migrated easily from one environment to another Certain functionality, such as declarative content types, custom file types and list views, can only be achieved within a Site Definition
  • 15. Site Definition Cons Existing sites will be affected if you make any changes on to the site definition. Site definitions by contrast require file system access to the SharePoint server, and the ability to reboot Microsoft Internet Information Services (IIS) for your development server. No debugging support -- It's easy to make a mistake in the sparsely documented landscape of site definitions. Requires knowledge of the Site Definition schema and XML Customization of site definition requires more effort than creating custom templates. Editing a site definition after it has been deployed is difficult. 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.
  • 16. Core Schema Files for Site Definition Table describes prominent XML files that can be modified for a site definition and shows their locations in the file system.
  • 17. Site Definition Vs Site Templates
  • 18. Deciding Between Site Definitions and Custom Site Templates Compare the Pros/Cons of Site Template and Site Definition If you need to make only minor changes in the look of certain pages and add a few fields in particular lists, you should create a custom site template. However, if you need to create new content types, add new Web Part definitions, and significantly restructure sites, you should create a custom site definition. Can you deploy changes to the front-end Web server? If you do not have access to the file system of the computers running Windows SharePoint Services, you have no choice but to create a custom site template. Custom site definitions hold the many advantages over custom site templates:
  • 19. Where the Feature Stapling comes to the picture? When you modify and customize an out-of-the-box site definition, you basically modify its onet.xml, master pages, page layouts, etc and you may also add new master pages, page layouts, web pages, etc. But if in future, you will install any service pack, hot fix, or upgrade to new version, most likely all your changes and customizations will be overwritten . Microsoft doesn't support changes made to a site definition after you've created the sites. Use the Feature stapling with Site definitions is the best option. You can use tools like SP Site Configurator to ease up. http://spsiteconfigurator.codeplex.com/ So if you want to do any modifications or customizations in out-of-the-box site definitions; develop them all as Features and staple them with the respective site definition.
  • 20. Solution Provided by the SharePoint – Feature Stapling In your site definitions, there are several ways of using features with it. These are:- Create a site from the definition and subsequently deploy your features to the site. (STSADM) Include the features in the site definition (onet.xml) before using it to create sites. Use feature stapling to associate your features to the site definition. SharePoint provides a solution to handle such kind of situations, and the solution is Feature Stapling. Feature Stapling allows you to “staple” a Feature to both out-of-the-box and custom site definitions without modifying them in any way.   This means you can add your Features to all sites created using that site definition.  It is easier to add additional functionality to site which are developed using a site definition in contrast with these built using a site template
  • 21. Include features in site definition - Example This option can be used if the site definition has not yet been deployed, and no sites have yet been created from it. The section of the onet.xml file where features are associated with the site definition as below: <Configuration ID="0" Name="BLANKINTERNET">     <SiteFeatures>         <Feature ID="C85E5759-F323-4EFB-B548-443D2216EFB5" />       <Feature ID="A392DA98-270B-4e85-9769-04C0FDE267AA" />         <Feature ID="7C637B23-06C4-472d-9A9A-7C175762C5C4" />     </SiteFeatures>     <WebFeatures>         <Feature ID="00BFEA71-DE22-43B2-A848-C05709900100" />         <Feature ID="00BFEA71-E717-4E80-AA17-D0C71B360101" />     </WebFeatures>     <Modules>         <Module Name="Home" />     </Modules> </Configuration>
  • 22. Use feature-stapling to associate your features to the site definition This option should be used when the site definition is already in use (and sites have been created). This is because there are risks in modifying a site definition once it has been deployed (Microsoft doesn’t support this) To use feature-stapling, you first need: the feature(s) you wish to link to the site definition Then, you should create a 2nd feature which does the actual stapling To staple a Feature to a site definition, you actually need to create another Feature that will do the stapling, and this feature is called as Stapler Feature. A feature which is going to be stapled/associated with a site definition is called as Staplee Feature. 
  • 23. Example for Feature Stapler Feature.xml file (for stapler feature): <xml version="1.0" encoding="utf-8" ?><Feature  Id="82E2EA42-39E2-4B27-8631-ED54C1CFC491"          Title="$Resources:MultiLangStaplingFeatureName"          Description="$Resources:MultiLangstaplingFeatureDescription"          Version="12.0.0.0"          Scope="Farm"          xmlns="http://schemas.microsoft.com/sharepoint/"          DefaultResourceFile="_Res">    <ElementManifests>        <ElementManifest Location="Elements.xml"/>    </ElementManifests></Feature> Elements.xml file (for stapler feature): <Elements xmlns="http://schemas.microsoft.com/sharepoint/">  <FeatureSiteTemplateAssociation Id="29D85C25-170C-4df9-A641-12DB0B9D4130" TemplateName="STS#0" />  <FeatureSiteTemplateAssociation Id="29D85C25-170C-4df9-A641-12DB0B9D4130" TemplateName="STS#1" />  <FeatureSiteTemplateAssociation Id="29D85C25-170C-4df9-A641-12DB0B9D4130" TemplateName="SPS#0" /></Elements> In the Above example, FeatureSiteTemplateAssociation element which basically defines the associations between Features and site definitions. In the above example, the stapler feature “staples” the staple Feature with the ID “29D85C25-170C-4df9-A641-12DB0B9D4130” to the STS#0, STS#1, and SPS#0 site definitions. TemplateName="GLOBAL" can be used to deploy for all sites.
  • 24. Resources Best practices resource center for SharePoint 2007http://technet.microsoft.com/en-us/office/sharepointserver/bb736746.aspx Patterns and practices SharePoint guidancehttp://www.codeplex.com/spg Creating a site Definition: http://www.sharepointblogs.com/tbaginski/archive/2007/08/16/creating-a-custom-site-definition-in-wss-v3-moss.aspx Deciding Between Custom Web Templates and Custom Site Definitions http://msdn.microsoft.com/en-us/library/aa979683.aspx Feature Stapling http://msdn.microsoft.com/en-us/library/bb861862.aspx Other resources such as http://www.codeplex.com / http://www.dutchsug.nl / www.microsoft.com/sharepoint
  • 25. Thank You! Send your queries to Salaudeen.Rajack@gmail.com