[Zope-Moz] Templates anyone?

Shalabh Chaturvedi shalabh@pspl.co.in
Sun, 27 Feb 2000 19:28:27 +0530


Hi All,

There is some talk going on in the PTK list about 'templates'. I have a feeling
that if done well, something on those lines could greatly benifit not only the
PTK but also our Studio and Zope in general. Here is my pitch:

Question:
  How many ways could one populate a html table with data from an sql
  method ?
  Not many, right ? It is possible to parameterize the mapping. So, instead of
  writing DTML to create a table filled with data from an SQLMethods, a user
  can just specify a set of parameters.

Picture this:
  A designer drags 'table' icon from a toolbar and drops it in the
  edit view of a document she is creating. She then grabs an SQLMethod icon
  (already created by a developer) and drops it onto the table in the edit
  view. Pop! up comes a box that allows the user to specify the columns, order
  etc and it's done. No DTML!

Obviously, this could be done not only for tables but other elements too.

How it would work (in brief):
  Consider a 'template' object that takes a input some parameters and produces
  *DTML*. When the template object is included in another object (DTML Document
  or Method or...) the parameters for the template are provided.
  During rendering the DTML produced by the template is evaluated and rendered.

Other issues:
  o  The template can be evaluated to produce DTML only once for each use.
  o  Extensiblity: Anyone should be able to create their own templates.


Related PTK list thread is 'DISCUSS: Changing template construction'
(http://lists.zope.org/pipermail/zope-ptk/2000-February/000347.html)


I'd love to hear any comments, ideas, questions, doubts (_anything_) you may
have.


Cheers,
Shalabh
____________________________________________
>>>  print reduce(lambda c,d:chr(ord(d)-2)+c,
     '>pk0qe0nrurBjdcncju>\"kfgxtwvcjE\"jdcncjU\014')
____________________________________________