{/doc/acs-templating/ {ACS Templating}} {Templating System Samples} Templating System Samples

Samples

Templating System : Demo As the links reveal, the "Data" files have the extension .tcl and the "Template" files have .adp . If you want to see a little behind the scenes, you can look at the Tcl code into which we compile the template. The last column will deliver the resulting page to your browser.

Mechanisms underlaid in red are known to not work.

General

DescriptionDataTemplateCompiled
Template
Output
Simple variable substitutionViewViewViewView
Using bind variables in your queryViewViewViewView
A plain Tcl page that returns its own outputViewNoneNoneView
Conditional ExpressionsViewViewViewView
CommentsNoneViewViewView

Combining templates

DescriptionDataTemplateCompiled
Template
Output
Include a template within another templateView include
included
include
included
View
Wrap a page within a master templateNone Slave
Master
Slave
Master
View
Using the default masterNoneViewViewView
Include with master and recursion.
Remember Fibonacci from pset 1, exercise 1?
Start
Included
Master
Start
Included
Master
Start
Included
Master
View

Embedded Tcl

DescriptionDataTemplateCompiled
Template
Output
Tcl escape with implicit outputViewViewViewView
Tcl escape with explicit outputNoneViewViewView
Template chunks within escaped Tcl code blocksViewViewViewView
Puts (if you absolutely must)ViewViewViewView

Iteration

To see the following examples with different data, you can enter additional users into the sample table with "a simple form" or change them with "editing: several pages in one" in section Using the Form Manager below.
DescriptionDataTemplateCompiled
Template
Output
Repeating template chunks for each row of a query resultViewViewViewView
Generating the multirow datasource in TCLViewViewViewView
Repeating template chunks for each row of a query result, with custom manipulation of dataViewViewViewView
Repeating template chunks with grouping ViewViewViewView
Repeating template chunks as cells of a gridViewViewViewView
Repeating template chunks for each element of a listViewViewViewView

Both Iteration and Composition

DescriptionDataTemplateCompiled
Template
Output
Apply different skins to the same dataView Plain
Fancy
Plain
Fancy
Plain
Fancy
Absolute
Passing a multirow datasource to an included pageView Outer
Included
Outer
Included
View
Processing a template from a string (not file)ViewViewViewView

Using ListBuilder

DescriptionDataTemplateCompiled
Template
Output
Simplest (single-column) list, no features View .tcl
postgres query
oracle query
No master
W/ master
No master
W/ master
No master
W/ master
Add some columns View .tcl
postgres query
oracle query
ViewViewView
Add the ability to sort by any column View .tcl
postgres query
oracle query
ViewViewView
Link the title to a one-note detail page index
detail
index
detail
index
detail
View
Add a bulk action to delete all checked notes index
delete
postgres query
oracle query
indexindexView
Add a single/non-bulk action to create a note index
add-edit
index
add-edit
index
add-edit
View
Add a filter index
postgres query
oracle query
index
index
View
Add pagination with no page group cache index
postgres query
oracle query
index
index
View
Add page group caching to pagination (no looks difference) index
add-edit
delete
index
index
View

Forms

DescriptionDataTemplateCompiled
Template
Output
Using ad_page_contractTarget Form
Target
Error Page
Form
Target
Error Page
Form
Target
 
Report an error related to a request.ViewViewPlainView

Using the Form Manager.

DescriptionDataTemplateCompiled
Template
Output
A simple formViewViewViewView
A form with button groupsView Simple
Gridded
Simple
Gridded
Simple
Gridded
A form with Select widgetsViewViewViewView
Custom validation of a requestViewViewViewInline Error Message
Sitewide Error Page
Valid Request
A form with the Date widgetViewViewViewView
Editing: several pages in oneViewViewViewView
A form with a custom confirmation pageView Submit
Confirm
Submit
Confirm
View
A form with display/edit modesViewViewViewView
A form with multiple submit buttonsViewViewViewView