适用于:SharePoint 2016 |SharePoint Foundation 2013 |SharePoint Online |SharePoint Server 2013
为 Web 模板 WSP 文件中的 elements.xml 文件的 WebTemplate 元素提供父元素。
定义
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<WebTemplate ...>
</Elements>
元素和属性
下面各部分介绍了属性、子元素和父元素。
Attributes
无
子元素
| 元素 | 说明 | 
|---|---|
| 为 Web 模板提供配置数据。 | 
父元素
无
备注
在也属于 WSP 文件的 feature.xml 文件的 ElementManifests 部分中引用 elements.xml 文件自身。为网站集激活该功能时,Web 模板可用于在集合内创建新网站。ElementManifests 部分还可标识 Onet.xml 文件,该文件包含 WebTemplate 子元素中未指定的 Web 模板的其他详细信息。
示例
下面是 Elements 元素的示例。
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
      <WebTemplate
        AdjustHijriDays="0"
        AlternateCssUrl=""
        AlternateHeader=""
        BaseTemplateID="9"
        BaseTemplateName="BLOG"
        BaseConfigurationID="0"
        CalendarType="1"
        Collation="25"
        ContainsDefaultLists="TRUE"
        CustomizedCssFiles=""
        CustomJSUrl=""
        Description="A 4th Generation Blog Site."
        ExcludeFromOfflineClient="FALSE"
        Locale="1033"
        Name="BlogIV"
        ParserEnabled="TRUE"
        PortalName=""
        PortalUrl=""
        PresenceEnabled="TRUE"
        ProductVersion="4"
        QuickLaunchEnabled="TRUE"
        Subweb="TRUE"
        SyndicationEnabled="TRUE"
        Time24="FALSE"
        TimeZone="13"
        Title="BlogIV"
        TreeViewEnabled="FALSE"
        UIVersionConfigurationEnabled="FALSE" />
    </Elements>