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 @@ + + + Templating System Tag Reference: Switch + + +

    Switch

    + + Templating System : + Designer Guide : + Tag Reference : Switch +
    + +

    Summary

    + +

    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.

    + +

    Usage Examples

    +
    +<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>
    +
    +

    +

    Notes

    + + + +
    + +templating@arsdigita.com