Introduction
The etal cgi script can be used to show a reformatted
version of a HTML page. This can be especially useful
for the on-the-fly generation of print-friendly
versions of HTML pages.
Additional 'tags' and information are used to indicate
which parts of the HTML pages are to be removed and
inserted by the etal cgi script.
Removing parts of the HTML page
The parts of the HTML pages that are to be removed by the etal cgi script should be enclosed between <!--ETALOFF--> and <!--/ETALOFF--> tags. Being HTML comments these 'tags' will be ignored by web browsers.
Inserting data into the HTML page
HTML data that should only be interpreted by browsers
when the etal cgi script is used should be enclosed
between <!--ETALON> and </ETALON-->
tags.
The starting 'ETALON tag', <!--ETALON>, is
itself the start of a HTML comment tag. The ending
'ETALON tag', </ETALON-->, is in fact the end of
a HTML comment tag. The result is that web browsers
will not interpret the data enclosed between these
'ETALON' tags. The etal cgi script merely removes these
'ETALON' tags, allowing the browser to interpret the
enclosed data.
Inserting URL
To insert the URL of the HTML page that is to be printed the 'tag' <!--ETALURL--> can be used. The etal.pl script will replace <!--ETALURL--> with the contents of the 'Referer' HTTP header.
Example of usage: changing style sheets
The following code will tell the browser to use the screen.css stylesheet, while ignoring the everthing from '<!--ETALON>' up to '</ETALON-->'. The etal cgi script, when called from the HTML page that contains these lines of HTML code, will remove everything from '<!--ETALOFF-->' up to '<!--/ETALOFF-->', and both 'ETALON' tags. As a result the browser will only receive the link to the print.css stylesheet.
<!--ETALOFF--> <LINK REL="stylesheet" HREF="/publications/stylesheets/screen.css"> <!--/ETALOFF--> <!--ETALON> <LINK REL="stylesheet" HREF="/publications/stylesheets/print.css"> </ETALON-->
How to call the cgi script etal
The etal cgi script can be called using a standard href
in an anchor tag. The program is available through the
URL '/cgi-bin/etal.pl' both on IntraComm and EUROPA. No
parameters are required.
The cgi program will try to fetch the content of the
HTML page on the local file system. If it doesn't find
it, it will try a HTTP GET. This way the etal cgi
script can be used for dynamically generated pages as
well (i.e.: ColdFusion applications).
Example
<A HREF="/cgi-bin/etal.pl">version imprimable</A>
Sample usage
You can find sample usage of this cgi on all pages of the IntraComm site of the Publications Office: /publications/index_en.htm