Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > Usability

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Creating HTML Templates and Pages

If building a website is akin to building a house, you are currently at the point at which you have your graphics and content (your building materials) and your file directory (your house frame). Now you can build your HTML templates and the contentless pages that get saved from them (drywalling your rooms). As the templates are being created, you will want to incorporate light scripting (wiring, plumbing, and other functionality). After that step, you will be able to populate your pages (furnish your house) as you get close to launch (your housewarming party).

The first HTML template sets the standard for globals such as navigation; table structure; HTML font usage; ALT, COMMENT, and TITLE tag treatments; and so on. Take the optimized graphics that were sliced from the graphic template, add any other elements that need to be included (including any light scripting that should be incorporated; light scripting is discussed next in this chapter), and build in HTML. Test the initial HTML file(s) on various browsers and platforms. Make sure the graphic template translates and the HTML tables don't break [6.9]. This file will be your base. If it is faulty and you don't fix it here, its errors will propagate in every page saved from it. Note that this testing is not considered QA per se; it is simply standard procedure for the production designer to check for errors.

Figure 6.9. Large graphic elements often get sliced into pieces for easier download. Beware of tables breaking. Shown here: with a workable table (on the left) and during pre-QA troubleshooting.

Save from this initial template to create a page — the first of many. This new page (no longer a template) becomes a designated page within the site and is ready to be populated with content, whether static or dynamic. These pages now can be linked and tested.

A Few Definitions for the Uninitiated

graphic template n. A layered, digital file (usually Photoshop or Fireworks) containing unrendered, editable text, built by a visual designer, that clearly indicates all information necessary for producing the design in HTML. Once a graphic template is sliced, optimized, and coded, it becomes an HTML page.

HTML template (also called HTML shell) n. An HTML page containing no page-specific content, built by the production designer by splicing together all the elements that were sliced and optimized from the graphic template. Visually matches the graphic template. (Utilized by production to create further files using the Save As command.)

optimize v. 1. To compress an image or code into as small a file size as possible to minimize download time. Usually saved in GIF or JPG format. 2. To webify, to make web ready.

slice v. To separate a graphic template (or a portion of a template) into two or more images (usually either GIF or JPG). n. A sectioned-off area of the Photoshop or Fireworks file designated to be a single image (usually either GIF or JPG).

splice v. To reassemble GIF and/or JPG images in a seamless manner using HTML so that the file, when viewed on a browser, looks like the original graphic template.

Version Control

Make sure it is very clear to anyone with access to the active HTML files when a file is being worked on. This is, obviously, meant to prevent two or more team members from working on a file at the same time. Such miscommunication usually results in wasted time, overwritten files, and lost work. If you have two or more people working on the HTML, having an established method of version control in place facilitates efficiency. Dreamweaver 4 includes a handy feature that allows people to check in and check out files. Third-party programs such as SourceSafe, Perforce, and WebDAV might be appropriate for your workflow as well.

As you build the HTML templates on which your pages will be based, the production designers should take care to adhere to visual standards established during the design phase and written into the Style Guide (see the end of Phase 3). In anticipation of the QA testing you will need to conduct later in this phase (the Testing part of this phase), keep checking your work against all browsers and on both the Macs you might be working on and the PCs most of your audience will use.

Including Includes

Is one of the reasons your site is being redesigned that it became cumbersome to upkeep? Sometimes a simple maintenance need like updating a copyright footer turns into such a mammoth job (as it would be on a site with hundreds of pages) that the updating task often goes undone. When building, you sometimes find yourself repeating things: bits of code, headers and footers, and so on across the entire site or at least on a majority of pages. Using the common example previously mentioned of a copyright footer, how do you change the year on every page? You can do one of the following:

  1. Hand open each page (time consuming) and edit each. Reupload each page.

  2. Do a global search-and-replace using an HTML editor. (This assumes that there are no variations and that your original text is all the same.) Reupload each page.

  3. Build an include. Reupload a single page.

An include (noun, not verb) is a chunk of text coded and stored separately but applied globally so it can be edited in one place. A JavaScript include is a repeating functionality. Rather than plugging the repeating code into every page, simply reference an external file that is saved on the server separately from the HTML page. No complicated nested frames necessary. An include is an src property (source indicator), which is not so different from an IMG tag (image indicator). It is even almost dynamic in this way, except that includes don't require a backend database. Note that using includes somewhat slows loading. Assess your priorities: Does ease of updating outweigh the quarter-second of loading? Probably yes, but it's worth the evaluation. Regardless, including an include streamlines future production and is a great feature for redesign projects for which upkeep was a challenge on the old site.

  • + Share This
  • 🔖 Save To Your Account