Nesting page templates

Show Me

You can use nested page templates to create multiple templates with a consistent look and feel. Nested page templates give you more flexibility in Web sites that have both static pages and dynamic pages.

Prerequisite: Creating a page template (You will use this template as the root template).

When a large Web site has several categorized pages and multiple templates are used to manage them, it can be difficult to manage common areas and content areas in the templates. Nested page templates help you manage common content when a Web site has both static pages (HTML) and dynamic pages (JSP).

A nested page template is a page template that is based on an existing page template (also known as the root template). A nested page template can have content areas inside the content area of the root template. These nested page template content areas are later filled in by the pages that are based on the nested page template. When a page is based on the nested template, all areas of the page are read-only except for the nested template content area.

  1. Choose File > New > Other > Web > Page Template File. The New Page Template File wizard opens.

  2. Name the file and choose a folder for the file.

  3. In the Markup Language field, choose either HTML or XHTML as the markup language.

  4. In the Model field, choose to create a blank template containing HTML, JSP, or Faces components.

  5. Select the Create from page template check box and click Next.

  6. Select the User-defined page template radio button and select the root template that you created earlier.

  7. Click Finish. The new nested page template opens in the editor. You can only edit inside the content area defined by the root template.

  8. From the Page Template drawer of the palette, drag a content area inside the content area defined by the root template. This is the nested template content area. This area will be editable on all pages created from the nested template.

  9. Add any other elements, such as text, to the common area of the nested template (the default area surrounding the nested template content area).

  10. Save the nested page template.

 

Related concepts

Page templates

 

Related tasks

Creating a page template
Laying out a page template with tables
Generating Web pages from page templates
Applying or replacing page templates
Applying a page template to a Web site
Adding content to a page template