Webgen (tm) phase0 File


The phase0 file contains one-time definitions of variables and procedures.

It is a good place to put stuff that is generally useful at all sites.

The phase0 file contains the bulk of the infrastructure to support the current template methadology. If you want to build templates differently, consider redefining the phase0 file. Here are some of the important procedures defined in phase0:

startleafpage
Opens the destination leaf html page and puts the open filehandle in the global variable "pages" for later use in the template. See also endleafpage.

startindexpage
Opens the destination index html page and puts the open filehandle in the global variable "pages" for further use in the template. See also endindexpage.
fixstr
Called on a string to correct funky characters. This function may be called on any string that needs to be "sanitized".

trf
Called on a string, it returns a safe unix filename based on the strings value. The trf function removes spaces, and other dangerous characters, for example.

filesize
Called with a path to a file, filesize returns a string sutiable for use in a html page describing the size of the file in bytes.

isnew
Called with a creation date argument, isnew returns 1 (true) if the date is within $whatsNewTime seconds and false otherwise. The variable whatsNewTime should be defined in the conf file.
mchk2list
Called on a "multi-check" data element, it converts the element to a TCL list object suitable for foreach loops and joins etc. A multi-check element is generated from a non-exclusive checkbox field.

promote
Called in an meta index template to promote a set of referenced index pages to a different ordering in the lindex list.

endleafpage
Closes the destination leaf html page. See also startleafpage.

endindexpage
Closes the destination index html page. See also startindexpage.

register
Registers the current leaf page to be indexed on a given index page. register takes the templateType of the index page as the first argument, and the instance name of the index page as the second argument. If the index template only has one instance, pass the instance name "main".

registerindex
Registers the current index page to be indexed on a given meta index page. registerindex takes the templateType of the meta index as the first argument, and the instance name of the meta index as the second argument.


ksedgwic@bonsai.com