Index: openacs-4/packages/acs-templating/www/doc/exercise/ats-for-designers.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/exercise/ats-for-designers.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/exercise/ats-for-designers.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/exercise/ats-for-designers.html 7 Aug 2017 23:48:03 -0000 1.2 @@ -5,7 +5,7 @@

The ACS Templating System for Web Designers

-Templating System : Templating Exercise +Templating System : Templating Exercise

Reading

@@ -33,7 +33,7 @@

First, perhaps an explanation of what the templating system does will help us understand how it works. An ATS template itself serves as a reusable, unchanging framework that delivers dynamic data. The advantage to this is something you probably already realize: you need only build -and edit a few pages to maintain a consistent presentation style while accomodating numerous permutaions of changing data. +and edit a few pages to maintain a consistent presentation style while accommodating numerous permutaions of changing data.

This training module will teach largely by exercise and example, but you should also refer regularly to the ATS documents provided and more specific pointers will be given to help you out along the way. @@ -51,7 +51,7 @@

-Exercise 1: Onevalues, onelists, multilists and multirows
+Exercise 1: Onevalues, onelists, multilists and multirows
(nestedlists, too?)

Let's first take a look at some list and variable tags in action. Open up another @@ -77,12 +77,12 @@ .adp file, are cycled repeatedly to show multiple sets of information when displayed in list-and-var-sample.acs; example:

-    <multiple name="your_multirow">
-    <tr><td>@your_multirow.first_names@ @your_multirow.last_name@ </td> </tr>
+    <multiple name="your_multirow">
+    <tr><td>@your_multirow.first_names@ @your_multirow.last_name@ </td> </tr>
     </multiple>
     
The user will see one table row filled with a different person's name for each row contained in the multirow - your_multirow. + your_multirow.
  • multirow variables are identified with this format: @<name of the multirow>.<name of a field in the multirow>@, and can only be called within their respective @@ -132,11 +132,11 @@ and movies you've possibly never seen.

    -Exercise Two: <if> and <else>, the conditional tags +Exercise Two: <if> and <else>, the conditional tags

    Dynamic data implies a changing page, and also changing presentation. The <if> and <else> tags allow -you to alter the format of your page to accomodate data changes. The +you to alter the format of your page to accommodate data changes. The function of <if> is straightforward enough: given a condition -- such as @x@ equals 5 -- all the text/html/dynamic data between the the opening @@ -149,16 +149,16 @@

  • in Tcl all variables, even numbers, are stored as text strings with quantitative values, so conditions like less than, greater than, and (not) between can also - be used with text to determine alphabetical order: a < b < ... < - z, lower-case letters are greater than upper-case, and numbers less than letters. + be used with text to determine alphabetical order: a < b < ... < + z, lower-case letters are greater than upper-case, and numbers less than letters. Example: "you" are greater than "me", and "I" am less than "you"
  • the "between" conditions checks inclusively, so <if 2 between 2 6> will test true
  • <if @a@ between @b@ @c@> requires that @a@ is greater than or equal to @b@ - and less than or equal to @c@; so <if + and less than or equal to @c@; so <if @x@ between 4 2> will always test false
  • the "in" condition uses a regular expression check (or will it? come @@ -171,11 +171,11 @@ description reads "likes chocolate" when likes_chocolate_p is "t", "doesn't like chocolate" when likes_chocolate_p is "f", or "probably like chocolate" if likes_chocolate_p is an empty string. -Also, add one <if>, and one <if> only, so that a is appropriately -changed to an for any 11-, 18- or 80- to 89-year olds. +Also, add one <if>, and one <if> only, so that a is appropriately +changed to an for any 11-, 18- or 80- to 89-year olds.

    -Exercise Three: The <master> and <slave> tags -- a call to the dominatrix in you +Exercise Three: The <master> and <slave> tags -- a call to the dominatrix in you

    The <master> and <slave> tags allow you to maintain a consistent style and format among pages @@ -211,7 +211,7 @@

  • the master page can be viewed at its own .acs page, but shows nothing in place of the <slave> tag
  • you can have nested slave sections, that is, a slave section within another slave
  • -
  • you cannot have two different slave sections within the same master (go ahead +
  • you cannot have two different slave sections within the same master (go ahead and try adding an extra <slave> tag to a master page to see what happens)
  • <property> tags are used within a slave section to pass text, HTML and references to local datasources up to the master page; these values @@ -233,14 +233,14 @@ with some slave-specific title.

    -Exercise Four: The functions of <formtemplate>
    +Exercise Four: The functions of <formtemplate>

    Creating forms with ATS can be as simple as inserting two tags into a page. Try this: open form-sample.adp and add the two following ATS tags:

    - + <formtemplate id="add_entry"></formtemplate> - +

    Save the page and reload it. You should see now see a big baby-blue form block; this is the @@ -276,7 +276,7 @@ There are noticeable differences between the two form templates, most obviously the lack of background color and a few missing entry fields in the manually constructed one. Maybe not so noticeable -is the grouping of entry widgets into one HTML table row (check out the Name field) and +is the grouping of entry widgets into one HTML table row (check out the Name field) and the multi-input combination of text entry boxes and radio buttons for entering telephone number information. Take a look at how the phone information entry section is constructed in form-sample.adp. Note specifically: <formgroup> is somewhat similar to @@ -298,17 +298,17 @@

    -Exercise Five: more fun with multirows +Exercise Five: more fun with multirows

    Now that you've confidently added the conditional <if> and <else> tags to your ATS toolbelt, it's time to put those tools to good use in formatting multirow data. First, read the docs to learn about -the automatcally generated @your_multirow.rownum@ column, -the @your_multirow:rowcount@ onevalue which contains +the automatcally generated @your_multirow.rownum@ column, +the @your_multirow:rowcount@ onevalue which contains the total number of rows contained in your multirow, and the <multiple> startrow and maxrows attributes. Possible point of confusion: the variable -@your_multirow:rowcount@ is a onevalue and not a column of the -multirow your_multirow, so it need not be used within <multiple> +@your_multirow:rowcount@ is a onevalue and not a column of the +multirow your_multirow, so it need not be used within <multiple> tags and in many cases should not be used within <multiple> tags. Why is this? (Take a look at how @address:rowcount@ is used.)