Forum OpenACS Development: Re: new templating model: ideas, questions

Collapse
Posted by Don Baccus on
I think the separation of script logic and presentation, as is done by the existing acs templating system, is a *good* thing.

In particular at Greenpeace, for instance, I extended ad_return_template to be "smart" about locale settings and to optionally return a custom .adp file for a particular locale if one is provided.  This means designers for various Greenpeace sites can simply modify the .adp files to change details of look and feel (though not structure to a very great degree) while all share a single Tcl script file.  The latter's kept safely in the hands of the programmers.

I don't understand the motivation here.  acs templating works very well and if I were to list 100 projects to work on to improve OpenACS, replacing it wouldn't be on the list.  Or the list of the next 100 projects.  And so on.

The ADP compiler can be extended with custom tags and you can dump Tcl code inline ("foreach") for instance.  What advantages would your templating system provide over that approach which we've rejected? (though this is how AOL writes their pages).

Collapse
Posted by Tom Jackson on

Separation of script and display code is important for the reasons you stated. This idea would never replace ATS because the functions in the ATS cover a very broad area. I like ATS, it works very well in most cases, and at the moment it is all that is available for OpenACS.

My motivation for working on this are stated above, where I listed the goals.

In addition, ATS only works with files, making it difficult to apply the separation concept outside of page display. It would be nice to have a merge feature where data can be setup inside a procedure and and a template could be sourced to produce a result. Any place that tcl code is used to create html or text or similar output, this idea would work well to simplify the code.

Also, ATS uses the adpparse code from AOLserver. The tags are actually registered just like regular ADP tags. Because of the design, you cannot rely on the system to protect you from malicious or mistaken programming errors by the template designer. The entire server api is available for their use. This precludes a number of possibilities that I am interested in.