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. 01 Jan 1999 at 00:00

    This thread is for discussions of Creating a Template.

  2. 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

Leave a comment

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

Robert J. Walker

Related discussion

Related podcasts

  • Herding Code: Herding Code 59: Web Standards with Milan Negovan

    Published 10 months ago, running time 0h56m

    In this episode of the Herding Code Podcast, the guys sit down with Milan Negovan of ASP.NET Resources to discuss web standards, usability and accessibility.  Milan also shares his opinions on the onslaught of new technologies coming out of Redmond, why developers should avoid big conferences, th... web standards, asp, out, usability

Events coming up

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