Partager via


Configuration Element

The Configuration element specifies the lists and modules used in creating a SharePoint site.

Syntax

<Configuration>
</Configuration>

Attributes

Name Description
Description Optional Text. Contains the description of the site configuration that appears on the Template Selection page.
Hidden Optional Boolean. Specifies whether the site configuration appears as an option on the Template Selection page.
ID Required Integer. Specifies a unique ID for the configuration.
ImageUrl Optional Text. Contains the URL for the preview image displayed on the Template Selection page.
Name Optional Text. Contains the name of the configuration.
Title Optional Text. Contains the title of the configuration that is displayed on the Template Selection page.
Type Optional Text. Identifies the configuration with a specific site definition.

Element Relationships

Parent Elements Child Elements
Configurations, Template ExecuteUrl, Lists, Modules

Remarks

The Configuration element is used in both the WEBTEMP.XML and ONET.XML files to define a configuration of lists and modules that can be used to create a site. In WEBTEMP.XML, this element is contained within a Template element that specifies the configurations that make up a site definition. In ONET.XML, this element is contained within a Configurations element that specifies the configurations whose lists are defined within ONET.XML. The ID attribute associates the configuration specified in a site template with a configuration of list definitions in ONET.XML.

Example

The following example from WEBTEMP.XML specifies three configurations for a site template.

<Template Name="STS"  ID="1">
   <Configuration ID="0" Title="Team Site" Type="0" Hidden="FALSE" ImageUrl="images/stsprev.jpg"
      Description="This template creates a site for teams to create, organize, and share information
      quickly and easily. It includes a Document Library, and basic lists such as Announcements, Events,
      Contacts, and Quick Links.">
   </Configuration>
   <Configuration ID="1" Title="Blank Site" Type="0" Hidden="FALSE" ImageUrl="images/blnkprev.jpg"
      Description="This template creates a Windows SharePoint Services-enabled Web site with a blank
      home page. You can use a Windows SharePoint Services-compatible Web page editor to add interactive
      lists or any other Windows SharePoint Services features.">
   </Configuration>
   <Configuration ID="2" Title="Document Workspace" Type="0" Hidden="FALSE" ImageUrl="images/dwsprev.jpg"
      Description="This template creates a site for colleagues to work together on documents. It provides
      a Document Library for storing the primary document and supporting files, a Task list for assigning to-do
      items, and a Links list for resources related to the document.">
   </Configuration>
</Template>

The following example shows how the previous configurations are specified in ONET.XML.

<Configurations>
   <Configuration ID="-1" Name="NewWeb"/>
   <Configuration ID="0" Name="Default">
      <Lists>
         <List Title="Shared Documents" Url="Shared Documents"
            QuickLaunchUrl="Shared Documents/Forms/AllItems.aspx" Type="101" />
         <List Title="General Discussion" Url="Lists/General Discussion"
            QuickLaunchUrl="Lists/General Discussion/AllItems.aspx" Type="108" />
         <List Title="Announcements" Type="104" Url="Lists/Announcements" />
         <List Title="Links" Type="103" Url="Lists/Links" />
         <List Title="Contacts"  Url="Lists/Contacts"
            QuickLaunchUrl="Lists/Contacts/AllItems.aspx" Type="105" />
         <List Title="Events" Type="106" Url="Lists/Events" />
         <List Title="Tasks"  Url="Lists/Tasks" QuickLaunchUrl="Lists/Tasks/AllItems.aspx"
            Type="107" />
         <List Title="Site Template Catalog" Type="111" Url="_catalogs/wt" RootWebOnly="TRUE" />
         <List Title="Web Part Catalog" Type="113" Url="_catalogs/wp" RootWebOnly="TRUE" />
         <List Title="List Template Catalog" Type="114" Url="_catalogs/lt" RootWebOnly="TRUE" />
      </Lists>
      <Modules>
         <Module Name="Default"/>
         <Module Name="WebPartPopulation"/>
      </Modules>
   </Configuration>
   <Configuration ID="1" Name="Blank">
      <Lists>
         <List Title="Site Template Catalog" Type="111" Url="_catalogs/wt" RootWebOnly="TRUE" />
         <List Title="Web Part Catalog" Type="113" Url="_catalogs/wp" RootWebOnly="TRUE" />
          <List Title="List Template Catalog" Type="114" Url="_catalogs/lt" RootWebOnly="TRUE" />
       </Lists>
       <Modules>
          <Module Name="DefaultBlank"/>
          <Module Name="WebPartPopulation"/>
       </Modules>
   </Configuration>
   <Configuration ID="2" Name="DWS">
      <Lists>
         <List Title="Shared Documents" Type="101" />
         <List Title="General Discussion" Url="Lists/General Discussion"
            QuickLaunchUrl="Lists/General Discussion/AllItems.aspx" Type="108" />
         <List Title="Announcements" Type="104" Url="Lists/Announcements" />
         <List Title="Contacts" Url="Lists/Contacts" QuickLaunchUrl="Lists/Contacts/AllItems.aspx"
            Type="105" />
         <List Title="Links" Type="103" Url="Lists/Links" />
         <List Title="Events" Url="Lists/Events" QuickLaunchUrl="Lists/Events/AllItems.aspx"
            Type="106" />
         <List Title="Tasks" Type="107" />
         <List Title="Site Template Catalog" Type="111" Url="_catalogs/wt" RootWebOnly="TRUE" />
         <List Title="Web Part Catalog" Type="113" Url="_catalogs/wp" RootWebOnly="TRUE" />
         <List Title="List Template Catalog" Type="114" Url="_catalogs/lt" RootWebOnly="TRUE" />
      </Lists>
      <Modules>
         <Module Name="DWS"/>
         <Module Name="WebPartPopulation"/>
      </Modules>
   </Configuration>
</Configurations>