Share via


SPWebTemplate class

代表站台定義組態或用來建立 SharePoint 網站的網站範本

Inheritance hierarchy

System.Object
  Microsoft.SharePoint.SPWebTemplate
    Microsoft.SharePoint.SPCustomWebTemplate

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Class SPWebTemplate
'用途
Dim instance As SPWebTemplate
public class SPWebTemplate

備註

雖然網站範本會儲存為SharePoint Foundation資料庫中的.wsp 檔案%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\範本內的檔案中包含站台定義設定。

您可以使用SPSite類別的GetCustomWebTemplates方法,傳回透過使用者介面或物件模型,建立Web 範本的集合,或使用SPSite類別的GetWebTemplates方法,在網站集合中傳回的站台定義設定集合。集合的參照之後,可用於索引子,並傳回單一站台定義組態或站台範本。例如,如果集合指派給一個名為mySiteTemplates變數,Microsoft Visual C#,或mySiteTemplates(index) 在 Microsoft Visual Basic,其中index是標題或索引中的數字的站台定義設定] 或 [網站範本集合中使用mySiteTemplates[index]。

網站定義,是一種針對一或多個站台定義設定的容器,表示,在Collaborative Application Markup Language (CAML)標記中,由範本項目在WebTemp*.xml檔案中的目錄%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LCID\XML\,其中LCID是您語言/文化特性例如英文的1033的數值 ID。如何站台定義組態 UI 中顯示使用者在建立新的站台時,是由 <設定> 項目的子項目範本的其中一個所決定。站台定義設定的詳細資料會儲存在組態中的項目中的目錄%ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\SiteTemplates\site_type的Onet.xml檔案的其中一個 \XML\,其中site_type是 「 STS","SGS,""MPS,""部落格 」 「 WIKI,""CENTRALADMIN,""TENANTADMIN,"或自訂網站定義的名稱。

網站範本壓縮成.wsp 檔案elements.xml檔案中定義。(.Wsp 檔案是封包檔。您可以開啟它在 Windows 檔案總管] 中如果先將副檔名變更為.cab。)

注意事項注意事項

雖然站台定義組態或自訂的網站範本,可以代表SPWebTemplate , SPCustomWebTemplate永遠表示自訂網站範本。

Thread safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

請參閱

參照

SPWebTemplate members

Microsoft.SharePoint namespace

SPCustomWebTemplate

其他資源

Onet.xml

WebTemp.xml

共同作業應用程式標記語言 (連同 CAML)

How to: Create a Web Site Definition from an Existing Web Site Definition

Custom Site Templates

Site Definitions and Configurations