Index: openacs-4/packages/acs-templating/www/doc/migration.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/migration.adp,v diff -u -r1.3.2.12 -r1.3.2.13 --- openacs-4/packages/acs-templating/www/doc/migration.adp 7 Nov 2016 19:23:16 -0000 1.3.2.12 +++ openacs-4/packages/acs-templating/www/doc/migration.adp 22 Apr 2017 18:33:51 -0000 1.3.2.13 @@ -7,7 +7,7 @@ : Migration

In a Nutshell

-When templatizing a legacy tcl page, your task is to +When templatizing a legacy Tcl page, your task is to separate code and graphical presentation. The latter goes into an ADP file; it contains essentially HTML, @@ -27,7 +27,7 @@ queries needed to define these data sources. There are special mechanisms for handling multirow data sources; see below.

At the end of the Tcl script, you should call -ad_return_template. The template runs after the tcl +ad_return_template. The template runs after the Tcl script, and can use these data sources.

Make sure that the fancy adp parser is enabled in your AOL ini file.

@@ -40,11 +40,11 @@
  • Do not write to the connection directly. Avoid ns_puts, ns_write etc., which don't wait till the headers are written or the page is completed; they -may act differently than you expect.
  • If you can, put code in the tcl file, not between <% -%> in the adp page.
  • Put HTML in the adp page, not int the tcl program. Put reusable +may act differently than you expect.
  • If you can, put code in the Tcl file, not between <% +%> in the adp page.
  • Put HTML in the adp page, not int the Tcl program. Put reusable HTML fragments in a separate adp file (think of it as a widget) that will be <include>d from several pages. -Prefer this to writing a tcl proc that returns HTML.
  • Remember to remove backslashes where you had to escape special +Prefer this to writing a Tcl proc that returns HTML.
  • Remember to remove backslashes where you had to escape special characters, as in
     Nuts  \$2.70 \[<a href="\"shoppe\">buy</a>\]
    @@ -65,7 +65,7 @@
     panes fit next to each other and to line up corresponding code.

    - + @@ -215,7 +215,7 @@ module that uses the mechanism, not a whole page.
    old tcl codenewold Tcl codenew
    packages/news/www/item-view.tclpackages/news/www/item-view.adp
    - + @@ -353,11 +353,11 @@ own multirow variable. In the excert below, taken from /pvt/alerts.tcl and /pvt/alerts.adp, the foreach logic made it hard to use the db_multirow because it needed a combination of the -output from sql and also the output of tcl procedures using that +output from sql and also the output of Tcl procedures using that value.

    old tcl codenewold Tcl codenew
    packages/news/www/index.tclpackages/news/www/index.adp
    - +
    old tcl codenewold Tcl codenew
    packages/acs-core-ui/www/pvt/alerts.tclpackages/acs-core-ui/www/pvt/alerts.adp