Index: openacs-4/packages/acs-templating/www/doc/developer-guide.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/developer-guide.adp,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/acs-templating/www/doc/developer-guide.adp 27 Oct 2014 16:40:13 -0000 1.2
+++ openacs-4/packages/acs-templating/www/doc/developer-guide.adp 7 Aug 2017 23:48:02 -0000 1.3
@@ -1,21 +1,26 @@
- The optional Programmer / Developer Guide
Templating System : Developer Guide
+Programmer / Developer Guide
+Templating System
+ : Developer Guide
Mini How To
-Start a Tcl page as usual with ad_page_contract
. Be
-sure to pass a -properties
block; this signals the use
-of templating. The tcl page should fill the data sources you
+
+Start a Tcl page as usual with ad_page_contract
+. Be
+sure to pass a -properties
+ block; this signals the use
+of templating. The Tcl page should fill the data sources you
promised in the contract, and not write to the connection. At the
-end of your tcl page, call ad_return_template
. The
+end of your Tcl page, call ad_return_template
+. The
template system will look for an adp page with the file name stub
-you indicate (defaulting to the same stub as the tcl page), process
+you indicate (defaulting to the same stub as the Tcl page), process
that, and deliver it to the client. The adp page can use the
-datasources defined in the tcl page.
-Guide
+datasources defined in the Tcl page.
+
+Guide
+
@@ -40,7 +45,8 @@
types
+
@@ -52,34 +58,44 @@
in memory
API
+API
+
After the script for a page is executed, acs-templating processes
the template, interpolating any data sources and executing the
special tags. The resulting HTML page is written to the connection
(i.e., returned to the user).
-Normally, does nothing at all. With the ad_return_template
-string
option
+
+Normally, does nothing at all. With the -string
+ option
you get the resulting HTML page returned as a string.
template
argument is a path to a page
-(tcl/adp file pair). Note that you don't supply the ".tcl" or
-".adp" extension. It is resolved by help of
-template::util::url_to_file
(with the current file
-stub as reference path) and passed to
+(tcl/adp file pair). Note that you don't supply the
+".tcl" or ".adp" extension. It is resolved by
+help of template::util::url_to_file
(with the current
+file stub as reference path) and passed to
template::set_file
, to change the name of the page
-being served currently. If it starts with a "/", it is taken to be
-a path relative to the server root; otherwise it is a filename
-relative to the directory of the tcl script.
+being served currently. If it starts with a "/", it is
+taken to be a path relative to the server root; otherwise it is a
+filename relative to the directory of the Tcl script.ad_page_contract
ad_page_contract
-return_errors
you can name a variable into
+option -return_errors
+ you can name a variable into
which to put any error messages as a list, and
-ad_page_contract
will return in any case. You can then
+ad_page_contract
+ will return in any case. You can then
present the errors to the user in a templated page, consistent with
-the look and feel of the rest of your service. If there's no
-complaint, ad_page_contract
won't touch the variable;
-typically it will stay undefined.
-ad_page_contract
+ won't touch the
+variable; typically it will stay undefined.
+