The following is the detailed the instructions of how to deploy Master Page and Custom Page Layout together
1. The following is the directory structure which I suggest when creating your own features
2. Under the PageLayouts folder you will see two files:
· MoscowLayout.aspx: this page is the custom page layout you created
· MoscowLayout.xml: this is the manifest files that identifies your custom page layout
You can put as much as custom page layout pages as you want in this folder, but you only need
one manifest file
3. The content of MoscowLayout.xml should be looks like:
<Elements xmlns=”http://schemas.microsoft.com/sharepoint/” >
<Module Name =”MOSCOWPageLayouts” Url =”_catalogs/masterpage”
Path =”PageLayouts” RootWebOnly =”TRUE”>
<File Url =”MoscowLayout.aspx” Type =”GhostableInLibrary”>
<Property Name =”Title” Value=”XXX”/>
<Property Name =”MasterPageDescription” Value=”XXX”/>
<Property Name =”ContentType” Value =”$Resources:cmscore,contenttype_pagelayout_name;”/>
<Property Name=”PublishingPreviewImage” Value =”~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/ArticleLeft.png, ~SiteCollection/_catalogs/masterpage/$Resources:core,Culture;/Preview Images/ArticleLeft.png”/>
</File>
</Module>
</Elements>
Module: indicate to SharePoint the location of the aspx pages. MoscowLayout.aspx is part of your feature and must be copied along with all of the other parts to the features folder. During the activation of your feature, it will be dropped in the Master Page and Page Layout gallery.
File: defines the path to your page and the type. GhostableInLibrary tells SharePoint to create a list item to go with your file when it is added to MasterPage and Page Layout gallery. Ghostable is used if you are provisioning a file outside a document library
Two important properties:
ContentType: OOTB Master Page Gallery has two content type associated with it. The value will either be master page or page layout.
Publishing AssociationConetentType: Specify ContentType to which your custom page layout is associated. The value of this one is composed of the name of your content type and the ID of content type. If this value is omitted, by default your layout will be associated with the basic ‘Page’ content type from the publishing feature
4. You put your master page, css file into MoscowMasterPage. The wollongongmaster.xml manifest file should look like the following:
<Elements xmlns=”http://schemas.microsoft.com/sharepoint/”>
<Module Name=”MasterPages” List=”116″ Url=”_catalogs/masterpage”>
<File Url=”Moscow.master” Type=”GhostableInLibrary” />
</Module>
<Module Name=”WollongongStyles” Url=”Style Library” RootWebOnly =”TRUE”>
<File Url=”Moscow.css” Type =”GhostableInLibrary”/>
</Module>
</Elements>
5. Under the folder MoscowFeature, you will see Feature.xml, it will look similar to
<Feature Id=”{6EAA33DF-AD39-4a2c-B5AB-972A576D7CF4}”
Title=”Moscow Branding”
Description=”Master Page and page layouts for Moscow”
Version=”1.0.0.0″
Scope=”Site”
Hidden=”FALSE” xmlns=”http://schemas.microsoft.com/sharepoint/“>
<ElementManifests>
<ElementFile Location=”PageLayouts\MoscowLayout.aspx”/>
<ElementManifest Location=”PageLayouts\MoscowLayout.xml” />
<ElementManifest Location =”MoscowMasterPage\wollongongmaster.xml”/>
</ElementManifests>
</Feature>
It contains ElementManifest files for master page and page layout.
This is just an example to give you a general idea of how custom page layout should be deployed. It depends on how individual elements are structured. And install.bat file is important as well because you need to copy the files to the right location in your 12 hives.