SlideShare una empresa de Scribd logo
1 de 16
Mark Collins
Senior SharePoint Consultant
Kiefer Consulting
How can sites be created?
•   Site Definitions
•   Feature Stapling
•   Site Templates
•   Custom Code
•   Provisioning Providers
•   Web Templates
Method             PRO                                 CON
Site Definition    Powerful method for site            •   Farm Level Solution
                   creation – only way to create       •   Can’t be changed once a site has been built
                   customized sites in 2007                using the definition
                                                       •   Generally not supported in hosted/online
                                                           services
Feature Stapling   Extends existing site definitions   •   Only activated at site provisioning
                                                       •   Doesn’t provide new site definitions only
                                                           extends existing
Site Templates     •   Easy to create using the UI     •   Do not work with publishing features enabled
                   •   Can be stored off and           •   Only available in site collection where created
                       modified using Visual Studio        unless exported to Visual Studio and
                                                           deployed
Web Templates      •   Can be deployed as farm or      •   Does not support variations
                       site scoped
                   •   Feature based so items are
                       stored in the DB, making
                       them Cloud friendly
                   •   Can be used with publishing
                       features turned on
                   •   Created in Visual Studio
Provisioning       •   Flexible code based system      •   Require WebTemp*.xml on file system so are
Providers                                                  generally not supported by Cloud systems
                                                       •   Potential to be deprecated
1
                                       14TemplateFeature<Feature Folder>


                                                     Elements.xml
                                            XML                     2

 Onet.xml
                XML
                                   XML 14TemplateFeature<Feature Folder>
                                          Onet.xml
14TemplateSiteTemplates<base>
                                                        3
                                          XML

                                     14TemplateFeature<Feature Folder>

                      4                             features.xml
How to create Web Templates
• Open Visual Studio
• Create a blank SharePoint Project
• Create Folders for the various items that you will be
  using
   – Images (Mapped SharePoint Folder)
   – Lists (For any custom lists that you will be creating)
   – ContentTypes (for custom lists)
   – PropertyBag (used to identify the template after it has
     been created)
   – WebTemplates (where the web templates will be created)
   – SitePagesModule (Location of the pages to be deployed
     with the web template)
How to create Web Templates
• Create any content types need for list
• Create any lists that will be used
• Add any images that are needed by the
  project
• Create the property bag element
• Create any page modules and page layouts
  that will be used by the web template
How to create Web Templates
• Add Features to the project
  – Farm scoped features for web templates used to
    create top level sites
  – Site scoped features for web templates that are
    used to create sites within the site collection
  – Create features for each of the property bags (web
    scope)
  – Create features for the lists and page modules
    (web scope)
How to create Web Templates
• Add an empty element under the WebTemplates
  directory
• Edit the empty element and add a
  <WebTemplate> Element with the name the
  same as the parent element
• Add a Onet.xml file to the same location as the
  Element.xml used to create the WebTemplate,
  and set its deployment option to Element
• Edit the Onet.xml with the appropriate Site and
  Web features. Remove all unnecessary
  components
WebTemplate Element Structure
• <?xml version="1.0" encoding="utf-8"?>
• <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
• <WebTemplate
•    BaseConfigurationID=""
•    BaseTemplateID=""
•    BaseTemplateName=""
•    Name=""
•    Description=""
•    DisplayCategory=""
•    Title="">
• </WebTemplate>
• </Elements>
Basic Web Template
Demo
Best Practices
• Create Folders for Items
• Create PropertyBag and associate it with the
  WebTemplate
• Use the Webtemp*.xml files to determine the
  site definition the is most like the site you are
  trying to create and use its “fingerprint”
  – WebTemp.xml file located in the %ProgramFiles%Common FilesMicrosoft
    Sharedweb server extensions14TEMPLATELCIDXML

• Comment your features in the Onet.xml file
Potential Issues
• WebTemplate Name is not the same as the
  Folder that it is in
• Onet.xml deployment type not set to
  ElementFile
• Web Templates only work with Configuration
  ID 0
• Site Features are only activated for top level
  sites in a site collection
References
•   http://blogs.msdn.com/b/vesku/archive/2010/10/14/sharepoint-2010-and-web-
    templates.aspx
•   http://www.chakkaradeep.com/post/Web-Templates-and-Publishing-Sites.aspx
•   http://sharepointchick.com/archive/0001/01/01/site-definitions-vs.-
    webtemplates.aspx
•   http://sharepointchick.com/archive/2011/02/10/using-web-templates-to-create-
    site-collections.aspx

•   Mark Collins mcollins@kieferconsulting.com
Join us right after the event here at the
Woodlake Hotel for SharePint! Socialize and
    unwind after our day of learning.

Más contenido relacionado

La actualidad más candente

Drupal content editor flexibility
Drupal content editor flexibilityDrupal content editor flexibility
Drupal content editor flexibilityhernanibf
 
#SPSLondon - Session 2 JSLink for IT Pros
#SPSLondon - Session 2 JSLink for IT Pros#SPSLondon - Session 2 JSLink for IT Pros
#SPSLondon - Session 2 JSLink for IT ProsPaul Hunt
 
One Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp LondonOne Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp Londonhernanibf
 
The WordPress University
The WordPress UniversityThe WordPress University
The WordPress UniversityStephanie Leary
 
Spsbe using js-linkanddisplaytemplates
Spsbe   using js-linkanddisplaytemplatesSpsbe   using js-linkanddisplaytemplates
Spsbe using js-linkanddisplaytemplatesPaul Hunt
 
Zurb foundation
Zurb foundationZurb foundation
Zurb foundationsean_todd
 
WordPress Themes 101 - PSUWeb13 Workshop
WordPress Themes 101 - PSUWeb13 WorkshopWordPress Themes 101 - PSUWeb13 Workshop
WordPress Themes 101 - PSUWeb13 WorkshopCurtiss Grymala
 
Academic Websites in Plone
Academic Websites in PloneAcademic Websites in Plone
Academic Websites in PloneJazkarta, Inc.
 
Online exhibits in Plone
Online exhibits in PloneOnline exhibits in Plone
Online exhibits in PloneJazkarta, Inc.
 
Anatomy and Architecture of a WordPress Theme
Anatomy and Architecture of a WordPress ThemeAnatomy and Architecture of a WordPress Theme
Anatomy and Architecture of a WordPress ThemeJulie Kuehl
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016David Brattoli
 
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
Writing a WordPress Theme - HighEdWeb 2013 #WRK2Writing a WordPress Theme - HighEdWeb 2013 #WRK2
Writing a WordPress Theme - HighEdWeb 2013 #WRK2Curtiss Grymala
 
WordPress - fixing sites with problems
WordPress - fixing sites with problemsWordPress - fixing sites with problems
WordPress - fixing sites with problemsVictoria Pickering
 
itPage LDC 09 Presentation
itPage LDC 09 PresentationitPage LDC 09 Presentation
itPage LDC 09 PresentationEric Landmann
 
Drupal - Blocks vs Context vs Panels
Drupal - Blocks vs Context vs PanelsDrupal - Blocks vs Context vs Panels
Drupal - Blocks vs Context vs PanelsDavid Burns
 
WordPress Beginners Workshop
WordPress Beginners WorkshopWordPress Beginners Workshop
WordPress Beginners WorkshopThe Toolbox, Inc.
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With LoveUp2 Technology
 

La actualidad más candente (20)

Drupal content editor flexibility
Drupal content editor flexibilityDrupal content editor flexibility
Drupal content editor flexibility
 
#SPSLondon - Session 2 JSLink for IT Pros
#SPSLondon - Session 2 JSLink for IT Pros#SPSLondon - Session 2 JSLink for IT Pros
#SPSLondon - Session 2 JSLink for IT Pros
 
Wordpress overview
Wordpress overviewWordpress overview
Wordpress overview
 
One Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp LondonOne Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp London
 
The WordPress University
The WordPress UniversityThe WordPress University
The WordPress University
 
Spsbe using js-linkanddisplaytemplates
Spsbe   using js-linkanddisplaytemplatesSpsbe   using js-linkanddisplaytemplates
Spsbe using js-linkanddisplaytemplates
 
Zurb foundation
Zurb foundationZurb foundation
Zurb foundation
 
WordPress Themes 101 - PSUWeb13 Workshop
WordPress Themes 101 - PSUWeb13 WorkshopWordPress Themes 101 - PSUWeb13 Workshop
WordPress Themes 101 - PSUWeb13 Workshop
 
Academic Websites in Plone
Academic Websites in PloneAcademic Websites in Plone
Academic Websites in Plone
 
Online exhibits in Plone
Online exhibits in PloneOnline exhibits in Plone
Online exhibits in Plone
 
Anatomy and Architecture of a WordPress Theme
Anatomy and Architecture of a WordPress ThemeAnatomy and Architecture of a WordPress Theme
Anatomy and Architecture of a WordPress Theme
 
Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016Responsive themeworkshop wcneo2016
Responsive themeworkshop wcneo2016
 
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
Writing a WordPress Theme - HighEdWeb 2013 #WRK2Writing a WordPress Theme - HighEdWeb 2013 #WRK2
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
 
WordPress - fixing sites with problems
WordPress - fixing sites with problemsWordPress - fixing sites with problems
WordPress - fixing sites with problems
 
itPage LDC 09 Presentation
itPage LDC 09 PresentationitPage LDC 09 Presentation
itPage LDC 09 Presentation
 
nicoleregowebsite
nicoleregowebsitenicoleregowebsite
nicoleregowebsite
 
Drupal - Blocks vs Context vs Panels
Drupal - Blocks vs Context vs PanelsDrupal - Blocks vs Context vs Panels
Drupal - Blocks vs Context vs Panels
 
WordPress Beginners Workshop
WordPress Beginners WorkshopWordPress Beginners Workshop
WordPress Beginners Workshop
 
Pimp your wp site
Pimp your wp sitePimp your wp site
Pimp your wp site
 
From WordPress With Love
From WordPress With LoveFrom WordPress With Love
From WordPress With Love
 

Similar a Creating Web Templates for SharePoint 2010

Intro to SharePoint 2013 Branding
Intro to SharePoint 2013 BrandingIntro to SharePoint 2013 Branding
Intro to SharePoint 2013 BrandingThomas Daly
 
Intro to SharePoint 2010 development for .NET developers
Intro to SharePoint 2010 development for .NET developersIntro to SharePoint 2010 development for .NET developers
Intro to SharePoint 2010 development for .NET developersJohn Ferringer
 
Envision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the EnterpriseEnvision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the EnterpriseEnvision IT
 
Creating Landing Pages for Drupal 8
Creating Landing Pages for Drupal 8Creating Landing Pages for Drupal 8
Creating Landing Pages for Drupal 8Exove
 
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...Richard Calderon
 
SharePoint 2013 Branding
SharePoint 2013 BrandingSharePoint 2013 Branding
SharePoint 2013 BrandingKashif Imran
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!Ben Steinhauser
 
Maintainable Sitecore Solutions
Maintainable Sitecore SolutionsMaintainable Sitecore Solutions
Maintainable Sitecore SolutionsThomas Eldblom
 
Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friendWebcomponents are your frameworks best friend
Webcomponents are your frameworks best friendFilip Bruun Bech-Larsen
 
CUST-2 New Client Configuration & Extension Points in Share
CUST-2 New Client Configuration & Extension Points in ShareCUST-2 New Client Configuration & Extension Points in Share
CUST-2 New Client Configuration & Extension Points in ShareAlfresco Software
 
SharePoint Development in Government Environments
SharePoint Development in Government EnvironmentsSharePoint Development in Government Environments
SharePoint Development in Government EnvironmentsGunjan Datta
 
JSLink for ITPros - SharePoint Saturday Jersey
JSLink for ITPros - SharePoint Saturday JerseyJSLink for ITPros - SharePoint Saturday Jersey
JSLink for ITPros - SharePoint Saturday JerseyPaul Hunt
 
Creating an Amazing Intranet
Creating an Amazing IntranetCreating an Amazing Intranet
Creating an Amazing Intranethaiyankhan
 
SharePoint Development in Government Environments
SharePoint Development in Government EnvironmentsSharePoint Development in Government Environments
SharePoint Development in Government EnvironmentsGunjan Datta
 
Implementing SharePoint: Site Customization and Branding
Implementing SharePoint: Site Customization and BrandingImplementing SharePoint: Site Customization and Branding
Implementing SharePoint: Site Customization and Brandingdrudolph11
 
SPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint BeastSPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint BeastMark Rackley
 
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint BeastMark Rackley
 
Introduction to SharePoint 2013 WCM-DM-ECM for Business Users and Developers
Introduction to SharePoint 2013 WCM-DM-ECM for Business Users and DevelopersIntroduction to SharePoint 2013 WCM-DM-ECM for Business Users and Developers
Introduction to SharePoint 2013 WCM-DM-ECM for Business Users and DevelopersNetwoven Inc.
 

Similar a Creating Web Templates for SharePoint 2010 (20)

Intro to SharePoint 2013 Branding
Intro to SharePoint 2013 BrandingIntro to SharePoint 2013 Branding
Intro to SharePoint 2013 Branding
 
Intro to SharePoint 2010 development for .NET developers
Intro to SharePoint 2010 development for .NET developersIntro to SharePoint 2010 development for .NET developers
Intro to SharePoint 2010 development for .NET developers
 
Envision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the EnterpriseEnvision IT - Application Lifecycle Management for SharePoint in the Enterprise
Envision IT - Application Lifecycle Management for SharePoint in the Enterprise
 
Creating Landing Pages for Drupal 8
Creating Landing Pages for Drupal 8Creating Landing Pages for Drupal 8
Creating Landing Pages for Drupal 8
 
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
Better, Faster, Stronger! Boost Your Team-Based SharePoint Development Using ...
 
SharePoint 2013 Branding
SharePoint 2013 BrandingSharePoint 2013 Branding
SharePoint 2013 Branding
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!
 
Using Features
Using FeaturesUsing Features
Using Features
 
Maintainable Sitecore Solutions
Maintainable Sitecore SolutionsMaintainable Sitecore Solutions
Maintainable Sitecore Solutions
 
Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friendWebcomponents are your frameworks best friend
Webcomponents are your frameworks best friend
 
CUST-2 New Client Configuration & Extension Points in Share
CUST-2 New Client Configuration & Extension Points in ShareCUST-2 New Client Configuration & Extension Points in Share
CUST-2 New Client Configuration & Extension Points in Share
 
SharePoint Development in Government Environments
SharePoint Development in Government EnvironmentsSharePoint Development in Government Environments
SharePoint Development in Government Environments
 
JSLink for ITPros - SharePoint Saturday Jersey
JSLink for ITPros - SharePoint Saturday JerseyJSLink for ITPros - SharePoint Saturday Jersey
JSLink for ITPros - SharePoint Saturday Jersey
 
Creating an Amazing Intranet
Creating an Amazing IntranetCreating an Amazing Intranet
Creating an Amazing Intranet
 
SharePoint Development in Government Environments
SharePoint Development in Government EnvironmentsSharePoint Development in Government Environments
SharePoint Development in Government Environments
 
Implementing SharePoint: Site Customization and Branding
Implementing SharePoint: Site Customization and BrandingImplementing SharePoint: Site Customization and Branding
Implementing SharePoint: Site Customization and Branding
 
SPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint BeastSPSDenver - Wrapping Your Head Around the SharePoint Beast
SPSDenver - Wrapping Your Head Around the SharePoint Beast
 
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast2/15/2012 - Wrapping Your Head Around the SharePoint Beast
2/15/2012 - Wrapping Your Head Around the SharePoint Beast
 
Introduction to SharePoint 2013 WCM-DM-ECM for Business Users and Developers
Introduction to SharePoint 2013 WCM-DM-ECM for Business Users and DevelopersIntroduction to SharePoint 2013 WCM-DM-ECM for Business Users and Developers
Introduction to SharePoint 2013 WCM-DM-ECM for Business Users and Developers
 
Agile sites2
Agile sites2Agile sites2
Agile sites2
 

Creating Web Templates for SharePoint 2010

  • 1. Mark Collins Senior SharePoint Consultant Kiefer Consulting
  • 2. How can sites be created? • Site Definitions • Feature Stapling • Site Templates • Custom Code • Provisioning Providers • Web Templates
  • 3. Method PRO CON Site Definition Powerful method for site • Farm Level Solution creation – only way to create • Can’t be changed once a site has been built customized sites in 2007 using the definition • Generally not supported in hosted/online services Feature Stapling Extends existing site definitions • Only activated at site provisioning • Doesn’t provide new site definitions only extends existing Site Templates • Easy to create using the UI • Do not work with publishing features enabled • Can be stored off and • Only available in site collection where created modified using Visual Studio unless exported to Visual Studio and deployed Web Templates • Can be deployed as farm or • Does not support variations site scoped • Feature based so items are stored in the DB, making them Cloud friendly • Can be used with publishing features turned on • Created in Visual Studio Provisioning • Flexible code based system • Require WebTemp*.xml on file system so are Providers generally not supported by Cloud systems • Potential to be deprecated
  • 4. 1 14TemplateFeature<Feature Folder> Elements.xml XML 2 Onet.xml XML XML 14TemplateFeature<Feature Folder> Onet.xml 14TemplateSiteTemplates<base> 3 XML 14TemplateFeature<Feature Folder> 4 features.xml
  • 5. How to create Web Templates • Open Visual Studio • Create a blank SharePoint Project • Create Folders for the various items that you will be using – Images (Mapped SharePoint Folder) – Lists (For any custom lists that you will be creating) – ContentTypes (for custom lists) – PropertyBag (used to identify the template after it has been created) – WebTemplates (where the web templates will be created) – SitePagesModule (Location of the pages to be deployed with the web template)
  • 6. How to create Web Templates • Create any content types need for list • Create any lists that will be used • Add any images that are needed by the project • Create the property bag element • Create any page modules and page layouts that will be used by the web template
  • 7. How to create Web Templates • Add Features to the project – Farm scoped features for web templates used to create top level sites – Site scoped features for web templates that are used to create sites within the site collection – Create features for each of the property bags (web scope) – Create features for the lists and page modules (web scope)
  • 8. How to create Web Templates • Add an empty element under the WebTemplates directory • Edit the empty element and add a <WebTemplate> Element with the name the same as the parent element • Add a Onet.xml file to the same location as the Element.xml used to create the WebTemplate, and set its deployment option to Element • Edit the Onet.xml with the appropriate Site and Web features. Remove all unnecessary components
  • 9. WebTemplate Element Structure • <?xml version="1.0" encoding="utf-8"?> • <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> • <WebTemplate • BaseConfigurationID="" • BaseTemplateID="" • BaseTemplateName="" • Name="" • Description="" • DisplayCategory="" • Title=""> • </WebTemplate> • </Elements>
  • 11. Demo
  • 12. Best Practices • Create Folders for Items • Create PropertyBag and associate it with the WebTemplate • Use the Webtemp*.xml files to determine the site definition the is most like the site you are trying to create and use its “fingerprint” – WebTemp.xml file located in the %ProgramFiles%Common FilesMicrosoft Sharedweb server extensions14TEMPLATELCIDXML • Comment your features in the Onet.xml file
  • 13. Potential Issues • WebTemplate Name is not the same as the Folder that it is in • Onet.xml deployment type not set to ElementFile • Web Templates only work with Configuration ID 0 • Site Features are only activated for top level sites in a site collection
  • 14. References • http://blogs.msdn.com/b/vesku/archive/2010/10/14/sharepoint-2010-and-web- templates.aspx • http://www.chakkaradeep.com/post/Web-Templates-and-Publishing-Sites.aspx • http://sharepointchick.com/archive/0001/01/01/site-definitions-vs.- webtemplates.aspx • http://sharepointchick.com/archive/2011/02/10/using-web-templates-to-create- site-collections.aspx • Mark Collins mcollins@kieferconsulting.com
  • 15.
  • 16. Join us right after the event here at the Woodlake Hotel for SharePint! Socialize and unwind after our day of learning.

Notas del editor

  1. Site definitions are the classic xml files, which are for example used to provision out of the box sites. Many of the developers learned to create these in 2007 version, since they are very powerful and there were almost no other options available for introducing new options for the Create site functionality. As mentioned earlier site definition consists basically from two different files: WebTemp*.xml and onet.xml files.WebTemp*.xml defines how the site definition is visible for the end users and the onet.xml file contains the definitions for the actual site provisioning.We can only deploy site definitions using farm solutions, since files will be located in the file system. Primary purpose of the feature stapling is to extend and customize existing site definitions. Usually these are used to provide some custom functionalities for the out of the box site definitions, but technique is definitely available also for the custom site definitions. functionality used for saving existing sites as templatePortal provisioning providers are technique where we completely replace the onet.xml file using code (works with custom code)
  2. There is always custom code as well
  3. 1 From the site actions menu Clicking New Site provides the standard site Creation options.2 These sites are created through the Elements.xml file in the feature folder3 The Elements.xml file uses the onet.xml file to load features that define the website4 Once the site is created, it doesn’t reference the web template elements.xml and onet.xml file but the underlying Site Definition that is the basis for the web template (defined by the BaseTemplateID, BaseTemplateName and BaseConfigurationIdMakes for future upgrades easier (in theory)
  4. If the onet.xml file is not set as DeploymentType:ElementFile you will get a cryptic HRESULT errorIf the Name element in the element.xml file does not match the parent folder name you will also get the HRESULT error – this you usually won’t find on Google.Beware copy and paste errors. You may think you have everything, but sometimes you may not copy all the code or may need to change elements that you fail to change.
  5. Conclusion slide
  6. SharePint