I have create page layout and uploaded it to the master page gallery in a module, now I want to create a publishing page from this page layout, I know I should use a module and upload an .aspx page to the pages library. But what's the content of this .aspx page will be? for my page layout I know the exact html and everything, but for my publishing page what should I write inside? should I create an .aspx page with minimal html?

  • Take a look at Waldek's excellent post: blog.mastykarz.nl/… Commented Sep 8, 2013 at 15:36
  • @Robert - could you post that as an answer please (but not just the link, obviously)?
    – SPDoctor
    Commented Sep 17, 2013 at 8:16
  • Sure! I have tried to extract the most vital details Commented Sep 17, 2013 at 9:05

1 Answer 1


You can provision publishing pages using modules.

Add a new module to your project, and add the module to a feature.

Add a file to the module (in this case named TemplatePage.aspx) with the following content:

<%@ Page
PublicKeyToken=71e9bce111e9429c" %>
<%@ Reference VirtualPath="~TemplatePageUrl" %>
<%@ Reference VirtualPath="~masterurl/custom.master" %>

In the Elements.xml of the module you can use the following structure:

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Pages"
    <File Name="Page1.aspx" Url="Page1.aspx"
      Path="TemplatePage.aspx" Type="GhostableInLibrary"
      <Property Name="Title" Value="Lipsum"/>
      <Property Name="PublishingPageLayout"
      <Property Name="ContentType" Value="My page CT" />
      <Property Name="ContentTypeId"
        Value="0x010100C568DB52D9D0A14D9B2FDCC96666E9F200794..." />
      <Property Name="PublishingPageContent"
        Value="Lorem &lt;strong&gt;ipsum&lt;/strong&gt;
        &lt;em&gt;test add&lt;/em&gt;" />

As you can see you can modify the values for ContentType, ContentTypeId, PublishingPageLayout, Title and PublishingPageContent to match your project.

Waldek Mastykarz has an excellent and detailed walk-through here

  • I am trying to provision publishing page using Out Of the Box "Blank Page layout" which can be found at /_catalogs/masterpage/PageFromDocLayout.aspx. And add Content Editor webpart to that page. Can you please post how it can be achieve? PS: My end goal is to package SharePoint List and Pages (which includes customization using Content Editor Webpart). So that it can be easily deployed to any other machine.
    – Dipesh
    Commented Aug 20, 2018 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.