By Jennifer Kyrnin
When is the last time that you wished you could add in a copyright notice to every
one of your pages at once? Or perhaps you want to make sure that all your pages
have the same header and footer on them. Last week, I spoke about how to use
databases to create dynamic content, and they can also be used to create
standard content across your pages. But there is one drawback to most of those
systems. They are expensive.
Enter the HTML Pre-processor. The HTML pre-processor is an application that runs
on your server and filters the HTML before it is sent to the browser. They work
in many different ways, but for the Web developer they become invaluable in
creating dynamic pages with common elements.
Most pre-processors are run when you have created your data files. You can then
update your Web pages by running the processor to convert the data files to HTML.
The HyperText
Database mentioned last week worked in this fashion. But some
pre-processors work on the fly as the Web pages are accessed, ColdFusion is a
good example of this.
But there are many more pre-processors out there, many of which are freeware
and fairly easy to set up and use.
- PHP: Hypertext Processor
This is one of the better known open source HTML pre-processors available. However
it acts more than just a preprocessor, it is more like an HTML scripting tool to
include logic in your HTML and other programming functions. PHP runs on the Web
server. It comes in a Windows binary distribution and source code to compile on
other platforms. Open source freeware.
- GTML
GTML allows you to group your Web pages into projects for instant search and
replace capabilities across the whole project. You can easily create macros
for sections of your site that are reused and then simply put in the one word
representation of that code, GTML builds the HTML for you. GTML is a Perl
script, but will run on any platform that supports Perl. Open source
freeware.
- htmlpp - The HTML
Preprocessor
This HTML pre-processor has many of the same features as listed above, but one
really interesting aspect is that you can embed Perl code and include the output
on your HTML pages. It also can query flat file databases. GNU open source
freeware.
- HPP
HPP, while still under development, is an interesting looking Perl script that will
process directives sent to it via GET requests within Web pages. For example, you
would write your HPP enabled Web page, and then access it on the command line of
the browser: cgi-bin/hpp?index.html It gives you a lot of freedom to include the
results of Perl scripts in your Web pages dynamically. Alpha-level open source
freeware.
Previous Features