Index: openacs-4/packages/acs-templating/www/doc/appendices/memory.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/appendices/memory.adp,v diff -u -r1.2 -r1.2.2.1 --- openacs-4/packages/acs-templating/www/doc/appendices/memory.adp 27 Oct 2014 16:40:18 -0000 1.2 +++ openacs-4/packages/acs-templating/www/doc/appendices/memory.adp 25 Aug 2015 18:02:13 -0000 1.2.2.1 @@ -4,18 +4,21 @@ Templating System Appendix D: Parsing templates in memory - - -

Parsing Templates in Memory

The templating system code is oriented towards parsing templates +

Parsing Templates in Memory

+

The templating system code is oriented towards parsing templates stored in the file system, in conjunction with a Tcl script that is also stored as a file. However, when the template is not actually stored in the file system, you will need to parse it as a string in -memory. Two common situations in which this occurs are:

+

The Parsing Process

+

Whether the template is ultimately stored in a file or not, the templating system follows the same basic process during the parsing -process:

    +process:

    +
    1. Prepare data sources. Some Tcl code is evaluated to prepare data sources (scalars, lists, multirow data structures) for @@ -31,9 +34,12 @@ all variables declared as data sources are directly available to the template. The result of the evaluation step is a single string, which normally is written to the connection.
    2. -

    How to Parse Templates in Memory

    The templating system provides a low-level API that allows you +

+

How to Parse Templates in Memory

+

The templating system provides a low-level API that allows you to perform the three steps described above in the context of your -own code:

+own code:

+
 # set up any number of data sources:
 
 set first_name George
@@ -68,8 +74,11 @@
 
 # now use the output however you wish
 
-Also see the "string" demo. -

Generating Templates from Other Templates

In some cases, the template itself may be based on yet another + +Also see the "string +" demo. +

Generating Templates from Other Templates

+

In some cases, the template itself may be based on yet another base template. For example, the templating system itself generates form templates based on a generic "style" template. The generic template primarily depends on a single data source, @@ -78,11 +87,15 @@ lay out the specific formwidget and formgroup tags, along with labels and validation text, for the form. The output of this first step is then rendered into HTML and returned -to the user.

Note that the generic "style" template contains templating tags +to the user.

+

Note that the generic "style" template contains templating tags (formwidget, formgroup, if etc.) that must be "protected" during the first step. The templating system provides the noparse -tag to do this.


templating\@arsdigita.com
+tag to do this.

+
+templating\@arsdigita.com +
+ Last modified: $Id: memory.html,v 1.1.1.1 2001/03/13 22:59:27 ben Exp $ -