Conditional text include options are used to include or exclude specific passages of text and other items within a topic on the basis of one or more conditions.
See Command Line Options for details on how to use these options from the command line and in batch files.
A condition that starts before a table must end after the table. You cannot start a condition before a table and end it inside the table. Inside tables conditions must start and end inside the same cell. Conditional text cannot span table cells! |
This is the fastest and easiest way because it automatically inserts the condition tags at the beginning and end of the text and other content you want to tag. If you want to use an ELSE tag as well you must still insert it manually, however (see further below).
IF to include the selection if the condition is True when you publish (e.g. include text in CHM output) IFNOT to include the selection if the condition is False when you publish (e.g. include text in all outputs except CHM)
|
When you use this method you must insert the IF, ENDIF and ELSE (if used) tags separately, selecting the Conditional Text tool once for each individual tag.
IF to include the selection if the condition is True when you publish (e.g. include text in CHM output) IFNOT to include the selection if the condition is False when you publish (e.g. include text in all outputs except CHM)
|
You can nest conditional text blocks but do this with caution, it is easy to get confused with complex conditions and to produce unexpected results. Nested tags are evaluated starting with the outer tags. Evaluation stops as soon as a condition evaluates as false, effectively creating AND logic. For example: IF_CHM IF_DEMOBUILD content content content content ENDIF ENDIF In the above example the content will only be included if the output format is CHM and DEMOBUILD is selected in the Publish dialog. |
The ELSE condition can be used to provide an alternative text to be displayed if your main condition is not fulfilled. It is inserted as a single tag between a pair of IF/ENDIF or IFNOT/ENDIF tags. The ELSE condition is not associated with any include options. It simply provides an alternative block of content to be included if the previous conditions do are not evaluate as true when you compile.
If the main condition evaluates True when you publish then everything between the IF tag and the ELSE tag is output. If the main condition evaluates False when you publish then everything between the ELSE tag and the ENDIF tag is output. Example: The following condition will output TEXT 1 if the output format is HTML Help (CHM), otherwise it will output TEXT 2: IF_CHM Text 1 ELSE Text 2 ENDIF |
Double-click on the orange text condition tag in your text to display the Text Condition dialog, or right-click on the tag and select Edit. |
All content tagged with conditional text include options matching the Include Options selected here will be included or excluded in your output, depending on whether you used IF or IFNOT.
|
See also:
Conditions and Customized Output
Page url: http://www.helpandmanual.com/help/index.html?hm_advanced_conditions_conditionaltext.htm