Creating Page Layouts in SharePoint

SharePoint ships with several page layouts which authors can use to create different designs of welcome and detail pages, however you are not limited to using only the page layouts provided by SharePoint. You can create your own custom layouts or edit existing layouts. When deciding on how to approach a page layout customization, you should consider whether you wish to do the following:

  • Modify the layout of the content: If you only need to move content around the page, you should edit an existing page layout or else create a new layout which is based on an existing layout.
  • Display new types of content: If you need to store new types of content on a page, you should create a new content type. For example, if you need to create a custom page layout for authoring pages in a portal which is used to publish Marketing Department content you will need to create a new content type to store the Marketing content.

SharePoint Page layouts make extensive use of the  SharePoint of the site column model and  content type   to provide a framework for publishing online content. Page layout files in SharePoint are associated with a site content type. The content which can display on a page layout is defined by the site columns which are associated with the content type. Every site column which you create has an associated field control that is used to display the site column on that page layout.

For example, the Page Content site column is used to store HTML in several different page layouts such as  the Article page layout. In a page layout file, the Page Content field control is similar to below:

<PublishingWebControls:RichHtmlField
           FieldName="PublishingPageContent"
           runat="server" id="RichHtmlField2">
</PublishingWebControls:RichHtmlField>

As well as adding field controls, you may also add Web Part Zones to page layouts. Web Part Zones allow  page authors to add Web Parts to a page. It is common for  the page layouts which are based on the Welcome content type include Web Part Zones such as below:

<WebPartPages:WebPartZone runat="server" AllowPersonalization="true" ID="TopZone"
Title="<%$Resources:cms,WebPartZoneTitle_Top%>" FrameType="TitleBarOnly"  Orientation="Vertical">
<ZoneTemplate></ZoneTemplate>
</WebPartPages:WebPartZone>

You may also add Web Parts to the page outside a Web Part Zone, this means that the Web Part’s content appears on the page, but the page authors cannot move or configure that Web Part. Only Web Parts which are added to a Web Part Zone will be able to be modified by page authors. The best tool for this is SharePoint Designer which can be used to  drag and drop field controls, Web Part Zones, and Web Parts onto  the page layout. However, you may also open an existing page layout from the Master Pages gallery to look at some examples of ASP.NET. (see Using Master Pages in SharePoint for details on how to work with Master Pages)

Follow the below steps to create a new page layout:
Continues…

Pages: 1 2




Array

No comments yet... Be the first to leave a reply!