Adding content to a page template

Page templates contain both common and content areas. A common area is a shared area common to all of the pages that use the page template. A content area is an area where you would add information specific to the purpose of the page.

  1. Create a Web project

  2. Create a page template.

A common area contains page elements such as site banners, company logos, and navigation elements. A content area is an area specific to the particular pages that use the page template. A content area contains page elements such as text and images specific to the particular page.

The following illustrates the difference between the common area and the content area. The IBM® Web Site's page template contains both a common area and content area. The header and navigation panel are common to all of the pages in the Web site. The grey area is the content area that is specific to a particular page.

When the page template is applied to a Web page, the content unique to that page appears in the content area.

When you create a page template, the entire template is a common area by default. You must manually add content areas which will hold content that is unique to the pages that are based on the template. When you create a page based on a page template, the common area is read-only and the content area is editable.

To add content to a page template:

  1. Edit the common area. For example, add text, navigation, or a logo.

  2. To add a content area, click the Page Template drawer on the Palette.

  3. Drag the Content area object to the page template. The Insert Content Area for Page Template dialog box opens.

  4. Enter the name of the content area and click OK. When you have finished adding content areas to the page template, press CTRL+S to save your changes.

    Note:

    • If you are going to apply several styles or paragraph types to a content area, it is recommended to insert a content area inside the <BODY> tags of the page template or <TD> tags if the page template is using tables or free layout tables for layout. It is not recommended to insert a content area inside <P> or <SPAN> tags because you may have difficulty formatting text or adding styles to the content area from the page that uses the template. For example, if the content area is within the <P> tag in the page template, then in the Web page based on the page template, you will not be able to do anything that requires changing the <P> tag , such as changing the text in the content area to <H1>.

    • If you are going to apply just one style or paragraph type to an entire content area, you should insert the content area inside <TD> or <DIV> tags for a block (which forces a line break), or you can insert the content area inside <P> or <SPAN> tags if you want the content area to appear inline.

 

Related concepts

Page templates

Design-time page templates and dynamic page templates

Nested page templates

 

Related tasks

Creating a Web page template

Laying out a page template with tables

Generating Web pages from page templates

Applying or replacing page templates to Web pages

Applying a page template to a Web site

Creating a nested page template