Blank WebPart Page Properties

 

This short post contains the required properties for provisioning a Page Layout with  SharePoint deployment package. When you create a Visual Studio package which includes a page layout, you will need to provide the Page Layout  file properties in the Package Module Elements.xml file.

Please note that in this example I build my custom Page Layout based of the Blank WebPart Page.

I will provide more information on how to create a Package for deploying SharePoint Master Page and Page Layout in a future post.

<File Url="BlankWebPartPage.aspx" Type="GhostableInLibrary">
     <Property Name="Title" Value="$Resources:cmscore,PageLayout_BlankWebPartPage_Title;" />
     <Property Name="MasterPageDescription" Value="$Resources:cmscore,PageLayout_BlankWebPartPage_Description;" />
    <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
    <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/BlankWebPartPage.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/BlankWebPartPage.png" />
    <Property Name="PublishingAssociatedContentType" Value=";#$Resources:cmscore,contenttype_welcomepage_name;;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390064DEA0F50FC8C147B0B6EA0636C4A7D4;#" />
</File>

The above code was copied from the Hive 15 ProvisionedFiles.xml, you can find the path to the file here. This file contain SharePoint original provision code for the basic page layouts, including  the Article page layout and  Blank WebPart Page which is the base for my custom page layout.

You will need to change some attributes in the above code :

<Property Name="MasterPageDescription" Value="$Resources:cmscore,PageLayout_BlankWebPartPage_Description;" />

you can change the value to your own description for example :

“Custom page layout – Landing Page [for your project]”

<Property Name="MasterPageDescription" Value="Alfis Custom Landing page for project X" />

The final result should be as follow :

<Module Name="PageLayouts" RootWebOnly="TRUE" Url="_catalogs/masterpage">
  <File Path="PageLayouts\[Your page layout name].aspx" Url="[Your page layout name].aspx" Type="GhostableInLibrary" Level="Draft">
   <Property Name="FileLeafRef" Value="[Your page layout name].aspx" />
   <Property Name="MasterPageDescription" Value="[Your description for  the page]" />
   <Property Name="UIVersion" Value="15" />
   <Property Name="Title" Value="[Your Page Layout Title]" />
   <Property Name="PublishingHidden" Value="FALSE" />
   <Property Name="PublishingAssociatedContentType" Value=";#$Resources:cmscore,contenttype_welcomepage_name;;#0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF390064DEA0F50FC8C147B0B6EA0636C4A7D4;#" />
   <Property Name="HtmlDesignAssociated" Value="FALSE" />
   <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
   <Property Name="_ModerationStatus" Value="3" />
   <Property Name="FileDirRef" Value="_catalogs/masterpage" />
   <Property Name="FSObjType" Value="0" />
   <Property Name="PublishingPreviewImage" Value="~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/BlankWebPartPage.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/BlankWebPartPage.png" />

   </File>
</Module>

Leave a Reply

Your email address will not be published. Required fields are marked *