Site Definition (Onet.xml) files
Applies to: SharePoint 2016 | SharePoint Foundation 2013 | SharePoint Online | SharePoint Server 2013
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="http://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="http://schemas.microsoft.com/sharepoint/">
<Property Key="CopyLayouts" Value="true"/>
</Properties>
</Feature>
</WebFeatures>
<Modules></Modules>
</Configuration>
See also
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應