Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Looking For Help

From: petr:krenzelok:trz:cz at: 29-Jan-2003 16:02

Joel Neely wrote:
>Hi, Petr, > >Interesting comments, as usual! > >How about a simple first step (see below)? >
Well, I already did some first step, but it simply hardwires values into website source :-) We use: <!--Snowhill_name_start-->something here ...<!--end--> we simply look for certain section, replace data, begin to head of document to perform another section look-up .... now to your comments ....
>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 >
yes - that is what I meant by component/modules or modules/sub-modules (plug-ins). The module would be still called e.g. "table" and your typical row etc. values would be part of module config dialect, e.g. <!--[ module: "abc" version: 1.0.2 config: [ table-style typical-row repeat 2 rows ; different colors for first and second row, repeat those pairs times in cgi num-rows ; take number of rows from cgi env. variable .... ] ]-->
>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. >
hey, that's cute aproach! I will add it to list of the things to think about :-) There is of course many ways of how to use templates, what would have designer to do, how/where he/she would put template instructions into html source, how to easily maintain it on the server's side etc etc.
>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. >
Now I am lost with 1) and 2), but never mind :-) thanks for input, -pekr-