This article explains the similarities and differences associated with creating and provisioning of a custom pagelayout and a custom page in SharePoint with visual studio
If you are new to provisioning page and page layout with visual studio in SharePoint, then refer these articles on provisioning a page layout and provisioning a page.
The key difference between provisioning a page and a page layout in SharePoint is the target to which the file is provisioned. The page will be provisioned to “Pages” doc lib in a publishing site while a page layout will be provisioned to “_catalogs/masterpage”.
The file used to create and provision a pagelayout can also be used to create and provision a page without any change. The only change that is required is to change the provisioning location in module node of Elements.xml. To provision a page layout, Url attribute of module node has to be set to “_catalogs/masterpage”
<Module Name="BasePageLayouts" Url="_catalogs/masterpage" RootWebOnly="TRUE">
And for provisioning a page, the Url attribute has to be set to “Pages”
<Module Name="Pages" Url="Pages" RootWebOnly="TRUE">
Related Articles
Leave a comment