Forum OpenACS Development: Response to bt_mergepiece?? Templating

Collapse
Posted by Ben Adida on
I hope Philip sees this thread :) bt_mergepiece is probably one
of the oldest utilities written for AOLserver. It was originally
written for Naviserver 0.9 by Brian Tivol (do the initials bt make
sense now?) when Philip, Brian, and I worked on the Hearst
New Media site mmnewsstand.com (now dead) in 1995. I
rewrote it to be somewhat more efficient in 1996-7.

What does it do? It takes two arguments: a big chunk of HTML
that contains a raw form, and an ns_set that should be a bunch
of values for the fields in the HTML form. Usually, the ns_set
comes from a ns_db 1row query. The output is a chunk of HTML
that is exactly like the original chunk except that all vars in the
form now default to whatever values were in the ns_set. It works
with text fields, textareas, drop downs, radio boxes, etc... Pretty
useful stuff, but not exactly super efficient.