[Case Value]Text or WebDNA to display[/Case]
To display some HTML (or execute some WebDNA) from a list of known text options, put the text value inside a [Switch] context. For each possible option, put a [Case] context inside the [Switch]. You may optionally specify a default case by inserting a [Default] context. The [Default] context must be the very last context inside the [Switch]. This context can only be used within a [Switch] context.
Example (normally you would put the following text into a .tpl file on your server and use a web browser to link to it):
[text]x=5[/text] [Switch value=[x]] [Case value=1] The value of x was 1 [/Case] [Case value=2] The value of x was 2 [/Case] [Default] The value of x was neither 1 nor 2; it was [x] [/Default] [/Switch] [text]title=Mrs[/text] [Switch value=[title]] [Case value=Mr] You're a male [/Case] [Case value=Mrs] You're a female [/Case] [/Switch]
In the first example above, the text "The value of x was neither 1 nor 2; it was 5" will display, because the two cases for "1" and "2" did not match the actual value of x, which was "5". In the second example above, the text "You're a female" will display. Any WebDNA inside the other [Case] contexts will not execute, and any text inside those contexts will not display.