Difference between provisioning a custom pagelayout and custom page in SharePoint with Visual Studio

Ashok Raja
 
Solutions Architect
January 7, 2014
 
Rate this article
 
Views
394

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">
Note : The Name attribute in module element refers to the folder name in which the file is physically located inside the Feature folder.

Related Articles

Understanding the basics of how to create and provision a page layout in SharePoint 2013 with Visual Studio 2012

Understand the basics of how to create and provision a custom page in SharePoint 2013 with Visual Studio 2012

Category : Tips

Author Info

Ashok Raja
 
Solutions Architect
 
Rate this article
 
I am Ashok Raja, Share Point Consultant and Architect based out of Chennai, India. ...read more
 

Leave a comment