In a publishing environment we often create custom page layouts based on our own content types, and of course if we are also creating custom site definitions, we’ll probably want to create pages in the site defs which are based on our custom page laouts – how do we do this?

Again, it’s all done using a CAML module element as shown below

The Property elements are used to set the column values of the new list item which is created in the Pages library for this page.

  1. Title – The page title, this is what is usually displayed at the top of the browser window
  2. ContentType – the listitems contentype (name), which should be the content type used as the basis of the page layout
  3. PublishingPageLayout – this is the important one, this tells SharePoint what page layout to associate with the list item (page), it has a very specific format and a gotcha (see below)
  4. PublishingPageImage, PublishingPageContent etc – you can populate any other columns here.

The PublishingPageLayout property format is;

The gotcha is in the use of the comma (,); either don’t use it and just specify the url of the page layout, or, if you do use it make sure you leave a space character after the comma.

The title value specified after the comma is displayed in the “Page Layout” column in the Pages library.

About The Author

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">