Plan your conditional content
Conditions are what programmers call logical expressions. You must formulate a logical expression for each condition because a condition is always either true (met) or false (not met). You can use the same condition in many places in your document, for different types of conditional content.
To make conditional content work, you need to:
- Choose or define a variable.
- Define a logical expression (condition) involving the selected variable.
Choose or define a variable
You can use the following variables in your condition:
- User-defined variables
- Predefined OpenOffice.org variables, which use statistical values from the document properties
- User data
- Database field contents—for example from your address book
You cannot use internal variables (for example, page number or chapter name) to formulate conditions.
The examples in this chapter use user-defined variables.
Define a logical expression (condition) involving the selected variable
The condition compares a specified fixed value with the contents of a variable or database field.
To formulate a condition, use the same elements as you would to create a formula: operators, mathematical and statistical functions, number formats, variables, and constants. The possible operators are given in the online help; look in the index under “operators: in formulas”. You can define quite complex expressions, but in most cases a simple condition will do the job.