Library tutorials & articles

Creating a Template

Getting Started

Templating is a powerful technique to make managing a web site simpler and easier. It allows you to change many aspects of your site without having to change each page. I'll show you how to create a template for your site using the same technique I use for mine.

The first step is to design your template on paper. When designing the template, you need to lay out where important areas of the interface will be and what they'll look like. These areas include the page title, navigation and content areas. You may require more areas, depending on the needs of your site.

After the template is designed, write a prototype HTML page for the template. Insert placeholder text in the places where the text may change from page to page. Below is a simple layout and the corresponding code:

Page Title
Nav 1
Nav 2
Nav 3
Content goes here.

<html>
  <head>
    <title>Page Title</title>
  </head>
  <body>
    <table cellpadding="6" cellspacing="0" border="0">
      <tr>
        <td colspan="2" bgcolor="#aaaaff">
          <big><b>Page Title</b></big>
        </td>
      </tr>
      <tr>
        <td valign="top" bgcolor="#aaaaff" nowrap>
          Nav 1<br>
          Nav 2<br>
          Nav 3
        </td>
        <td valign="top" bgcolor="white">
          Content goes here.
        </td>
      </tr>
    </table>
  </body>
</html>

Comments

  1. 12 Jan 2004 at 03:33
    Robert,
    I thought this tutorial was very helpful. I was able to development many new ideas with this simple way of creating templates.

    Thanks,

    Lewis
  2. 01 Jan 1999 at 00:00

    This thread is for discussions of Creating a Template.

Leave a comment

Sign in or Join us (it's free).

Robert J. Walker

Want to stay in touch with what's going on? Follow us on twitter!