Showing posts with label web template. Show all posts
Showing posts with label web template. Show all posts

Tuesday, October 2, 2012

Back to basics : 5 All about onet xml

The global Onet.xml file defines list templates for hidden lists, list base types, a default definition configuration, and modules that apply globally to the deployment. Each Onet.xml file in a subdirectory of the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\SiteTemplates directory can define navigational areas, list templates, document templates, configurations, modules, components, and server email footers that are used in the site definition to which it corresponds.

When Microsoft SharePoint Foundation is installed, several Onet.xml files are installed—one in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\GLOBAL\XML that applies globally to the deployment, and several in different folders within %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\SiteTemplates. Each file in the latter group corresponds to a site definition that is included with SharePoint Foundation.

Depending on where an Onet.xml file is located and whether it is part of a site definition or a web template, the markup in the file does some or all of the following:

  • Specifies the web-scoped and site collection-scoped Features that are built-in to websites that are created from the site definition or web template.
  • Specifies the list types, pages, files, and Web Parts that are built-in to websites that are created from the site definition or web template.
  • Defines the top and side navigation areas that appear on the home page and in list views for a site definition.
  • Specifies the list definitions that are used in each site definition and whether they are available for creating lists in the user interface (UI).
  • Specifies document templates that are available in the site definition for creating document library lists in the UI, and specifies the files that are used in the document templates.
  • Defines the base list types from which default SharePoint Foundation lists are derived. (Only the global Onet.xml file serves this function. You cannot define new base list types.)
  • Specifies SharePoint Foundation components.
  • Defines the footer section used in server email.

You can perform the following kinds of tasks in a custom Onet.xml file that is used for either a custom site definition or a custom web template:

  • Specify an alternative cascading style sheet (CSS) file, JavaScript file, or ASPX header file for a site definition.
  • Modify navigation areas for the home page and list pages.
  • Add a new list definition as an option in the UI.
  • Define one configuration for the site definition or web template, specifying the lists, modules, files, and Web Parts that are included when the configuration is instantiated.
  • Specify Features to be included automatically with websites that are created from the site definition or web template

You can perform the following kinds of tasks in a custom Onet.xml file that is used for a custom site definition, but not in one that is used for a custom web template:


  • Add a document template for creating document libraries
  • Define more than one configuration for a site definition, specifying the lists, modules, files, and Web Parts that are included when the configuration is instantiated.
  • Define a custom footer for email messages that are sent from websites that are based on the site definition.
  • Define custom components, such as a file dialog box post processor, for websites that are based on the site definition.

Saturday, June 2, 2012

Site features causing issues - I found a resolution


I created site template by saving it from a minor customized blog site. I exported it in VS2010 and created a custom web template. Im seeing few site feature references along with some web features in its onet.xml.


After making the required changes, I

  1. deployed my solution in one of my web apps of my farm
  2. created a site collection from BLANK site template in that web app.
  3. activated my web template related features in my site collection
  4. Once I tried to create a sub site based on my Custom Web Tempplate, Im seeing the errors like "<GUID> feature not found"



The issue was due to the need of a manual activation of features referred in the Site Feature section of Web Template Onet.XML. All the features refered in Web Features section of  web template will get activated autoamtically when a site created using that template but the site features have to activated manually.


I resolved this issue by 


Removing the unwanted feature references from the Site Features section of Web Template.
Activating the required site features in a site collection feature prior to the web template based site creation.