Tuesday, January 3, 2012

Creating Web Templates for SharePoint Online - Office 365

As site definitions are not allowed in SharePoint Online the concept of WebTemplates cones into picture.
WebTemplates are pretty much similar to Site Definitions from the schema perspective. 

Steps for creating a custom web template :

  • Identify the type of web template you want to create i.e. it should be based on an existing Site Definition like Publishing Site, Blog Site, Wiki, etc
  • Create a custom onet.xml and copy the content from the site definition into the onet.xml.
  • Add all the custom components you would want to create as part of the webtemplate i.e. features, modules, lists, libraries, etc.
  • Create an elements.xml file and add a web template into it i.e. 


<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
   <WebTemplate Name="StoreWebTemplate" 
          BaseTemplateName="BLANKINTERNET" 
          BaseTemplateID="53"
          BaseConfigurationID="0"
          Title="Store"
          Description="Store web template"
          DisplayCategory="MindTree Store Portal"/>
</Elements>




You would notice that my web template is based on the publishing site definition i.e. BLANKINTERNET which is added as the BaseTemplateName attribute.

The BaseTemplateID can be obtained from the webtemp.xml file located in the 14 hive.

The rest of the attributes are self explanatory.

  • Now we are ready to package the webtemplate as a feature in a Sandboxed Solution and deploy it on SharePoint online.
  • Activating the feature should make the web template available for creating sub sites.

SharePoint 2010 Developer's Certification Exam preparation books available on amazon.com


Wrox has published a book to aid SharePoint Developers prepare for the SharePoint 2010 Developer certifications 70-573 and 70-576. The book is available on amazon

http://www.amazon.com/SharePoint-2010-Developers-Certification-Toolkit/dp/0470912340%3FSubscriptionId%3DAKIAJK4PAUN27E77K2EA%26tag%3Daglspt-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0470912340