Index: openacs-4/packages/acs-templating/www/doc/tagref/if.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/tagref/if.html,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/doc/tagref/if.html 13 Mar 2001 22:59:27 -0000 1.1 +++ openacs-4/packages/acs-templating/www/doc/tagref/if.html 14 Jan 2003 01:54:55 -0000 1.2 @@ -142,6 +142,22 @@ <td bgcolor=#0000ff> </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> + </if> + <elseif @datasource.variable@ eq "red"> + <td bgcolor=red> + </elseif> + <else> + <td bgcolor=#ffffff> + </else>+ +
The else tag may be used following an if block to specify an alternate template section when a condition is not true:
Index: openacs-4/packages/acs-templating/www/doc/tagref/index.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/tagref/index.html,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-templating/www/doc/tagref/index.html 30 Nov 2002 17:25:12 -0000 1.3 +++ openacs-4/packages/acs-templating/www/doc/tagref/index.html 14 Jan 2003 01:54:55 -0000 1.4 @@ -44,7 +44,8 @@<group>
<grid>
<list>
- <if>
+ <if>,<elseif>,<else>
+ <switch>,<case>,<default>
<include>
<include-optional>
<property>
Index: openacs-4/packages/acs-templating/www/doc/tagref/switch.html
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/doc/tagref/switch.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-templating/www/doc/tagref/switch.html 14 Jan 2003 01:54:55 -0000 1.1
@@ -0,0 +1,84 @@
+
+
+ The switch tag is used to output one of n-sections when the switch variable matches one of the n-case statements. A default section can also be output if none of the n-case statements matches the switch variable.
+ ++<switch @x@> + <case value="Fred"> + Hello Fred. + </case> + <case value="Greta"> + Hello Greta. + </case> + <case value="Sam"> + Hello Sam + </case> + <default> + I don't recognize your name. + </default> +</switch> ++
Tcl-equivalent flags have the same meaning as in the tcl-switch statement. Supported flags include exact, glob, and regexp.
++<switch flag=glob @x@> + <case value="F*"> + Hello Fred. + </case> + <case value="G*"> + Hello Greta. + </case> + <case value="H*"> + Hello Sam + </case> + <default> + You are in the section for people whose names start with F, G, or H. + </default> +</switch> ++
+Case tags also have an alternative form for matching a list of items.
++
+<switch @x@> + <case in "Fred" "Greta" "Sam"> + Your must be Fred Greta or Sam, but I'm not sure which one. + </case> + <default> + I don't recognize your name. + </default> +</switch> ++
+
Any legal variables that may be referenced in the template may +also be used in switch statements. + +
Phrases with spaces in them must be enclosed in double quotes and +curly braces to be matched correctly. Failure to quote words with spaces +correctly results in an error. +
+ <case "{blue sky}"> + <td bgcolor=#0000ff> + </case>+ +