共用方式為


Site Definition (Onet.xml) Files

Applies to: SharePoint Foundation 2010

In an Onet.xml file, the Feature element is used within a site definition configuration to contain a reference to a Feature instance and default property values. The Configuration element specifies lists and modules to use when creating SharePoint sites. For information about the format and elements used in site definitions, see Site Schema.

SharePoint Foundation activates Features specified within the Onet.xml file in the order that they are listed. Consequently, you must specify Features that are depended upon before Features that depend upon them.

Example

The following example shows the Feature element used to specify Features and Feature properties in a site definition configuration.

<Configuration ID="0" Name="Publishing"> 
   <Lists>
      <List Title="Web Part Gallery" Type="113" Url="_catalogs/wp" 
         RootWebOnly="True" />
   </Lists>
   <SiteFeatures>
      <Feature ID="AEBC918D-B20F-4a11-A1DB-9ED84D79C87E"/>
   </SiteFeatures>
   <WebFeatures>
      <Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416">
         <Properties xmlns="https://schemas.microsoft.com/sharepoint/">
            <Property Key="ChromeMasterUrl" Value=""/>
            <Property Key="WelcomePagePageLayoutUrl" Value=""/>
            <Property Key="WelcomePageUrl" Value=""/>
         </Properties>
      </Feature>
      <Feature ID="23BCB938-F4B5-42a4-8050-F8CB92EF4078">
         <Properties xmlns="https://schemas.microsoft.com/sharepoint/">
            <Property Key="CopyLayouts" Value="true"/>
         </Properties>
      </Feature>
   </WebFeatures>    
   <Modules></Modules>
</Configuration>

See Also

Concepts

Understanding Onet.xml Files

Site Schema

Understanding WebTemp*.xml Files