[REBOL] Re: Looking For Help
From: joel::neely::fedex::com at: 29-Jan-2003 7:48
Interesting comments, as usual!
How about a simple first step (see below)?
Petr Krenzelok wrote:
> However - that is not sufficient model for me. I strictly require
> division between database information maintainer, web designer and
> web programmer...
> But whole your .html file is treatened as one context. What happens if
> you have several tables in one html file, and need two 'email words? I
> don't want to use e.g. <%user/email%> and <%company/email%>.
Using the HTML-TEMPLATE from my previous reply, one could use something
like the following quick kludge:
1) create three template html files:
a) one for a "typical row"
b) one for the entire table "wrapper"
c) one for the entire page
2) create a table-maker wrapper for HTML-TEMPLATE that would take the
first two templates and a data source as arguments, and would:
a) initialize a content accumulator string to empty,
b) iterate through the data source, filling in the "typical row"
template for each chunk of source data (e.g. row of database)
with appropriate pre-processing, and append the result of each
iteration to the content accumulator,
c) upon completion, fill in the table "wrapper" template with the
content accumulator's value.
3) use the result of step (2) as a single value for the name/value pairs
to fill in the entire page template.
Of course, step (2) could be repeated as often as needed for multiple
tables within a single page, saving each table image under a different
name in the page's name/value block.
With all that said...
The above approach strikes me as a bit like "assembly language" where
the programmer has to tie everything together and follow all of the
appropriate conventions. It would be feasible IMHO either:
1) to extend the template notation to allow a page layout expert to
create a single page meta-template that would use additional
markup to show embedded structure, then a pre-process to break
that meta-template up into the collection of individual templates
used as above, or
2) build up the structure in code to take the meta-template and use
HTML-TEMPLATE as a low-level block to assemble an entire page at
a time, or
3) to stay with the above approach, given that one could define a
"flavor" of table/row combination once and re-use that same piece
of design across multiple pages.
Just for thinking about...