Home > Contents > Index > 
IF
Processes other tags or displays text based on a logical condition.
Syntax
<IF COND="LOGICAL_EXPRESSION"> <THEN> tags and/or text </THEN> <ELSE> tags and/or text </ELSE> </IF>Parameters
COND (required)- String comparison of two string values. The operators supported are "=" (values are equivalent) or "!=" (values are not equivalent)".
 
The following are conditions that Content Server provides for use with the
IFtag; all these subconditions return eithertrueorfalse:
 Tests whether this is a table. Tests for the existence of a column in a list. Tests for the existence of a counter. Tests for the existence of an element. Tests whether theerrnois actually an error. Tests for the existence of a list. Tests whether the given name is an object table. Tests for the existence of a session variable. Determine whether Content Server is revision tracking a specified table. Tests whether the given name is a tree table. Tests for the existence of a variable.Description
The
IFtag processes other tags or displays text based on a logical condition. If the condition is true, the content of theTHENtag is processed. If the condition is false, the content of theELSEtag is processed. TheTHENtag is required as part of anIFtag. TheELSEtag is not required.errno
The value of
errnois unchanged.Example
The following example prints the message
Color is red. if the value ofVariables.colorisred.<IF COND="Variables.color=red"> <THEN> Color is red.<br/> </THEN> <ELSE> Color is not red.<br/> </ELSE> </IF>This example tests for the existence of the variable,
color. If a variable namedcolorhas been set prior to this test,The variable color exists.is displayed.<IF COND="IsVariable.color=true"> <THEN> The variable color exists.<br/> </THEN> </IF>
Home > Contents > Index > ![]()
FatWire XML Tag Reference
Copyright 2005 by FatWire Software
All rights reserved.