In many SharePoint based projects, the client wants the flexibility to create and maintain pages at runtime following a few particular layouts. SharePoint provides an amazing solution to such kind of client expectations – The Publishing Page Feature. The core concept of the publishing page feature can be explained in 5 points:
- A Web developer creates and customizes the page layout in Office SharePoint Designer 2007.
- A content owner creates a new page based upon one of the available page layouts (in the browser).
- The content owner completes the page in the browser, and then submits it for approval.
- An authorized approver edits and then approves or rejects the article.
- Upon approval, the article is published.
Before starting let’s have a look at some of the important terms (Courtesy Office Support Site) which we are going to use throughout this post:
Create a Page Layout Content Type
A content type defines how the contributor should enter each type of content, how that content is displayed, and how it is handled in a workflow environment. Content types are added to the top-level site. Thereafter, they are available to all of the sub sites in that site collection. To create or edit content types, you must have authoring permissions on the top-level site. Following are the steps for creating a new content type:
- In the browser, do one of the following:
- From any team site, on the Site Actions menu, click Site Settings.
- From any portal area, click Site Actions, point to Site Settings, and then click Modify All Site Settings.
- On the Site Settings page, under Site Collection Administration, click Go to top level site settings.
Alternatively, you can browse directly to http://your_top_level_site/_layouts/settings.aspx. - Under Galleries, click Site content types.
- On the Site Content Type Gallery page, on the menu bar, click Create.
- In the Name box, type the name for this content type. This name will appear in the Content Types list when we will create the page layout.
- In the Description box, type a description for this content type.
- In the Select parent content type from list, click Publishing Content Types.
- In the Parent Content Type list, click Page.
- Under Put this site content type into, click Existing group, and then click Page Layout Content Types in the list.
To make your new content type available for page layouts that you create or customize in Office SharePoint Designer 2007, put the content type in the Page Layout Content Types group, where it will be easy to locate. The next section shows you how to use your new content type in Office SharePoint Designer 2007.
- Click OK.
The Site Content Type page opens.
For a better understanding of Content Type, read the following article:
Create a Page Layout
- In Office SharePoint Designer 2007, open the Web site in which you want to create the page layout.
- On the File menu, point to New, and then click SharePoint Content.
- In the New dialog box, click SharePoint Publishing.
If this option is not listed, it is probably because the site in which you are working does not have publishing turned on in Office SharePoint Server 2007. If you have authoring permissions on the top-level site, you can turn on publishing for the browser by pointing to Administration on the Office SharePoint Designer Site menu, and then clicking Administration Home. Under Site Administration, click Site features, and then click Activate next to the Office SharePoint Server Publishing option. After you perform these steps, return to Office SharePoint Designer 2007 and start over with step 1, but this time clicks Refresh on the View menu between step 1 and step 2.
- Click Page Layout.
- Under Options, in the Content Type Group list, click Page Layout Content Types.
- In the Content Type Name list, click the content type that you want.
If you created a content type in the previous section, and if you put your content type in the Page Layout Content Types group, you should see that content type in this list.
- In the URL Name box, type a name for this page layout.
This becomes the file name of the page layout. For example, if you type MyPageLayout
in this box, the page layout file name will be MyPageLayout.aspx. - In the Title box, type a title for this page layout.
This becomes the page layout title that appears in the list of available page layouts when you create a new publishing page on the Create page in the browser. You want to give the page layout a title that is recognizable to users who create publishing pages that are based on this page layout.
- Click OK.
The page layout opens in Design view.
The new page layout is created in the top-level site. You can verify that it was created by browsing to the Master Page Gallery at http://your_top_level_site/_catalogs/masterpage/Forms/AllItems.aspx where your_top_level_site is the name of the top-level site. Your new page layout should be listed on this page.
CodeProject