创建网站时,我需要在所有新页面和默认主页中使用空白网页部分页面。
这是我到目前为止所拥有的
<WebFeatures>
<!-- SharePoint Server Publishing -->
<Feature ID="94c94ca6-b32f-4da9-a9e3-1f3d343d7ecb" >
<Properties xmlns="http://schemas.microsoft.com/sharepoint/">
<Property Key="DefaultPageLayout" value="~SiteCollection/_catalogs/masterpage/BlankWebPartPage.aspx" />
</Properties>
</Feature>
<Modules>
<Module Name="DefaultBlank" Url="" Path="">
<File Url="default.aspx" NavBarHome="True" Type="Ghostable" >
<Property Key="PublishingPageLayout" value="~SiteCollection/_catalogs/masterpage/BlankWebPartPage.aspx, Blank Web Part Page" />
但我得到了这个例外
Microsoft.SharePoint.SPException: Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION)) ---> System.Runtime.InteropServices.COMException: Exception occurred. (Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION)) at Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId) at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId) --- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate, Int32& plWebTemplateId) at Microsoft.SharePoint.SPWeb.ProvisionWebTemplate(SPWebTemplate webTemplate, String webTemplateToUse, SPFeatureWebTemplate featureWebTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection`1& featureDependencyErrors) at Microsoft.SharePoint.SPWeb.ApplyWebTemplate(SPWebTemplate webTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection`1& featureDependencyErrors) at Microsoft.SharePoint.ApplicationPages.TemplatePickerUtil.ApplyWebTemplateAndRedirect(SPSiteAdministration siteAdministration, String strWebTemplate, String strRedirect, Boolean bCreateDefaultGroups, Page page, Boolean bDeleteOnError) Attempting to delete the site collection.
答案 0 :(得分:1)
这是如何使用Blank WebPart Page页面布局在发布“Pages”库中部署页面:
<Module Name="Pages" Url="Pages" RootWebOnly="FALSE" Path="Files\Pages" xmlns="http://schemas.microsoft.com/sharepoint/">
<File Url="Home.aspx" Type="GhostableInLibrary" Path="Home.aspx">
<Property Name="Title" Value="Welcome" />
<Property Name="ContentType" Value="Welcome Page" />
<Property Name="PublishingPageLayout" Value="~siteCollection/_catalogs/masterpage/BlankWebPartPage.aspx, Blank Web Part Page" />
</File>
</Module>