Index: openacs-4/packages/acs-templating/www/doc/tagref/if.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/tagref/if.adp,v diff -u -N -r1.3.2.4 -r1.3.2.5 --- openacs-4/packages/acs-templating/www/doc/tagref/if.adp 9 Jun 2016 13:03:12 -0000 1.3.2.4 +++ openacs-4/packages/acs-templating/www/doc/tagref/if.adp 22 Jun 2016 07:48:44 -0000 1.3.2.5 @@ -8,7 +8,7 @@ : Tag Reference : If
The if tag is used to output a template section only +
The if tag is used to output a template section only when certain conditions are met.
@@ -111,42 +111,42 @@Notes
Any legal variables that may be referenced in the template may -also be used in if statements. Words not surrounded with -the commerical at sign (\@) are interpreted literally.
Phrases with spaces in them must be enclosed in quotes to be grouped correctly:
<if \@datasource.variable\@ eq "blue sky"> - <td bgcolor=#0000ff> + <td bgcolor="#0000ff"> </if>
The elseif tag may be used following an if +
The elseif tag may be used following an if block to specify an alternate conditional template section.
<if \@datasource.variable\@ eq "blue"> - <td bgcolor=#0000ff> + <td bgcolor="#0000ff"> </if> <elseif \@datasource.variable\@ eq "red"> <td bgcolor=red> </elseif> <else> - <td bgcolor=#ffffff> + <td bgcolor="#ffffff"> </else>
The else tag may be used following an if block +
The else tag may be used following an if block to specify an alternate template section when a condition is not true:
<if \@datasource.variable\@ eq "blue"> - <td bgcolor=#0000ff> + <td bgcolor="#0000ff"> </if> <else> - <td bgcolor=#ffffff> + <td bgcolor="#ffffff"> </else>
Compound expressions can be created by combining terms with the -and and or keywords, as illustrated above. Any +and and or keywords, as illustrated above. Any number of statements may be connected in this fashion. There is no -way to group statements to change the order of evaluation.
When a variable is tested using the nil operator, it +way to group statements to change the order of evaluation.
When a variable is tested using the nil operator, it will return true if the variable is undefined or if the value of the variable is an empty string.