How to apply blank web part page layout to default page in onet.xml for a site template

0

I need to use the blank web part page in all the new pages and in the default home page when a site is created.

This is what I have so far

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

But I got this exception

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.
sharepoint
sharepoint-2013
asked on Stack Overflow Jun 6, 2013 by Luis Valencia

1 Answer

1

This is how to deploy a page in the publishing "Pages" library whith the BlankWebPartPage page layout :

<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>
answered on Stack Overflow Jun 6, 2013 by Cana

User contributions licensed under CC BY-SA 3.0