网站定义 (Onet.xml) 文件

上次修改时间: 2010年1月26日

适用范围: SharePoint Foundation 2010

Onet.xml 文件中,在网站定义配置内使用 Feature 元素可包含对 Feature 实例和默认属性值的引用。Configuration 元素指定在创建 SharePoint 网站时要使用的列表和模块。有关网站定义中使用的格式和元素的信息,请参阅网站架构

SharePoint Foundation 按照 Onet.xml 文件中指定的功能的列出顺序激活这些功能。因此,必须在依赖于某些功能的功能之前指定所依赖的这些功能。

示例

下面的示例演示用于在网站定义配置中指定 Features 和 Feature 属性的 Feature 元素。

<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>

请参阅

概念

了解 Onet.xml 文件

网站架构

了解 WebTemp*.xml 文件