Writer Guide
Hidden text
With hidden text (a word, phrase, or sentence), you have only two
choices: show or hide. If the condition you specify is met, the text is
hidden; if the condition is not met, the text is displayed. The
disadvantages are the same as for conditional text: you cannot include
graphics, edit the text in the body of the document, format part of the
text, or include a field.
Hidden paragraphs
Hidden paragraphs are like any other paragraphs, but you can specify
a condition under which the paragraph is not displayed or printed. A
blank paragraph can also be hidden—for example, if a database field
has no content for the current record. This is very useful when
merging an address into a letter: if you allow two lines for the street
address and the database record uses only one line, you can prevent
the blank line from appearing in your document. You can include
graphics, edit the text in the body of the document, format any part of
the text, and include fields.
Hidden sections
Hidden sections are like hidden paragraphs, but they can include more
than one paragraph—for example, a heading plus one or more
paragraphs. However, a section cannot contain less than a paragraph,
so you cannot use this method for single words or phrases. The
contents of a hidden section behave just like the contents of any other
part of the document, but you can specify a condition under which the
section is not displayed or printed. In addition, you can password
protect a section.
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:
1) Choose or define a variable.
2) Define a logical expression (condition) involving the selected
variable.
454 OpenOffice.org 3 Writer Guide