Understanding Conditional Text

Conditional text refers to text or graphics to which a condition attribute setting has been applied. Condition settings can be used to specify whether specific content is to be hidden or shown when generating publication output.

Conditional text allows topics to be reused across publications without constricting all the data to a specific publication. All information can be included in a topic and then conditions applied to that text that may be specific to a publication. You then can use condition settings to specify which content is appropriate when you perform a publish operation.

Before you can start using conditional text, you must consider the different contexts in which your topics will be viewed so that you can plan the appropriate conditions to apply.

There are other constructs that you can use to prepare publications for different audiences, such as variables, topic versions, and different map structures. If you are not sure which construct is most appropriate for the content, consult an information architect.

Increase Reuse Through Conditional Text

Reusing topics requires careful planning. Topics that are candidates for reuse often require small modifications when they are used in different contexts. Often, this issue is addressed with different copies of the same topic which makes the data, publications, and translation more complex and expensive to manage.

Content Manager strives to avoid the necessity of managing different copies of the same information. Conditional text enables you to store all variants of the content in the same topic. All variations of the content are stored in the same topic, with an indication (that is, a condition) of which context is to be used for specific publications. Based on these conditions, only the content that is valid in the given context appears in the published output. The biggest advantage of this approach is that technical writers need to manage and update only a a single set of source topics containing the data.

Adding conditions in the XML

You can add conditions to almost any element in the XML, including a sentence, a paragraph, a table row or column, a chapter, an entire section, and so on. The exact locations are defined in the DTD.

The condition indicating when a piece of content is valid is written in the XML attribute @ishcondition.

<p ishcondition="editor=Word">In MS Word, you click [...]</p>
<p ishcondition="editor='WP'">In WordPerfect, you select [...]</p>
In the example above:
  • The condition name is editor.
  • For some of the data, the condition is set to Word, and for other data, it is set to WP.

When publishing documentation for the Word application, the data with: ishcondition="editor=Word" is set for publication while the data with ishcondition="editor='WP'" is suppressed (not included in the publication).

Filtering During Publishing

Before a publication is rendered into the desired output, content that does not match the context is skipped. This enables you to generate different outputs from the same source by specifying different contexts when you publish. The variants of the documentation are generated automatically.

Synchronizing conditions

Often, condition names and values are maintained within another functional department of your organization. For example, the engineering department might keep track of all features that are added to the product, the marketing department might define localization strategies, and so on. To stay current with an external application that creates condition names and condition values, you can synchronize Content Manager with another system.