Create a news item page using a custom page layout

Before we go ahead and create a new page layout from the Design Manager, we have to create a custom content type for this layout. Site columns included in a content type defines the fields available on a page.

Create a Custom Content Type

  1. Go to the site collection top site, Site Settings page
  2. Click on Site content types under Web Designer Galleries
    Note: if you scroll down to the Page Layout Content Types, you will see some familiar names, such as Article Page which is associated with the Article Page Layouts
  3. From the top of the page, click Create
  4. Give this content type a name, for example, News Page
  5. Select parent content type from Publishing Content Types, and make Page the parent content type
  6. Choose a group, eg Custom Content Types
  7. Click OK

new content type

Once the content type is created, you will be taken to the Site Content Type page to manage the columns. The columns are copied from its parent content type, ie Page. You can modify the columns to suit your needs. In my case, I added a few more columns, most of them can be found on an article page:

  • Article Date – this is the date gets displayed in an article, different from when you created it
  • Byline – a short description line that can be used in the summary web part
  • News Type – this is a new site column I created to categorise my articles
  • Active – a checkbox, so I can hide some articles from view
  • Page Image – pre-defined image area
  • Image Caption – caption box for the page image
  • Summary Links

For the columns I don’t need, I made them hidden, so users won’t see them on either edit or display mode. Also, I changed the column order. It sets a good starting point for us later on editing the page layout. And below is my final product:

columns

Now, we have our new content type set, we can go ahead creating a new page layout.

Create a page layout

  1. From the site collection top site, click on the gear icon to bring up the settings menu, click Design Manager.
    Can’t find Design Manager anywhere? Read here
  2. In the left pane, click the 6th item Edit Page Layouts
  3. Click Create a page layout
  4. Create the News Page Layout using seattle Master Page and pick the content type you just created, ie News Page.
    Why seattle? Read here
    Create page layout
  5. Click OK to proceed
  6. When the layout is created, you will see it on the Edit Page Layouts page. To make the changes, you can either download the file or change it through the SharePoint Designer.
    draft layout.JPG
    Note: when a page layout is created, two files (.aspx and .html) are generated together. Anything you updated in the HTML will be reflected on the ASP page. However, if you changed the ASP page, it won’t let you save, because the changes won’t get translated to the HTML file automatically. You can manually break the link between these 2 files if you know what you’re doing.
    For editing, read
  7. Once you have finished editing, you will need to check in the file and publish it as a major version, so it’s available in the Layouts list.
    publish page layout.JPG

Now, you will find the News Page Layout in the Pages library.

pagelayout.JPG

It’s also added to the New Documents list.

newdoc.JPG

Thanks goes to the authors of these 2 articles I found online:

http://www.learningsharepoint.com/2013/03/03/create-a-custom-page-layout-in-sharepoint-2013/

http://www.dotnetcurry.com/ShowArticle.aspx?ID=638

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s