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>

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The trouble with programmers is that you can never tell what a programmer is doing until it's too late.” - Seymour Cray