Conditions in Tridion Docs
A condition is a rule that defines the selection criteria for determining what content to show. The basic rule construction is a condition name paired with a condition value. The condition names and values that are available must have been defined by your publication or project manager.
About conditional content
In the context of content management, the term conditional content means content that is included in the output only when specific criteria, the conditions, are met. This is comparable to filtering the publication output.
To make conditional content possible, you must first define your conditions to satisfy specific filtering requirements for viewing or publishing the data. For instance, data that is appropriate only in specific circumstances may be tagged with a condition that identifies it as such. When viewing or publishing, if a particular circumstance applies, then the data is included. However if the circumstance does not apply, the data can be filtered out so the reader does not see unrelated or inappropriate data. Conditions make it possible to generate significantly different output from the same set of objects.
The @ishcondition and condition context
In DITA generally, you make content conditional through use of DITA profiling attributes, such as @product, @platform and @audience, and possibly a ditaval file to specify which attributes to show or not to show. Tridion Docs works a little differently to provide greater flexibility.
- Rather than using the DITA profiling attributes, authors tag content with the Tridion Docs-specific XML attribute
@ishcondition. Within a single@ishconditionattribute, the value can be a simple name-value pair or a complex expression. - Rather than a
ditavalfile, Tridion Docs uses a publication's condition context to specify version-specific, publication-level filtering.
Condition types
You select the condition type when you create the condition name.
- Text
- Date
- Number
- Version
The condition name-value pair should encompass a minimal requirement. Writers can then combine conditions when necessary to appropriately tag data.
Allowed characters in condition names
- Numeric characters
- Alphabetic characters, including unicode characters
- Comma (,)
- Colon (:)
- Space
- Left bracket (<)
- Right bracket (>)
- Equal sign (=)
- Exclamation point (!)
- Left parenthesis ( ( )
- Right parenthesis ( ) )
If these characters are used, Content Manager converts the character to an underscore and the value with the underscore is stored in the Internal Name field. The value in the Internal Name field is used when Content Manager calculates the condition for publication.
Allowed characters in condition values
- Numeric characters
- Alphabetic characters, including unicode characters
- Comma (,)
- Colon (:)
If these characters are used, Content Manager converts the character to an underscore and the value with the underscore is stored in the Internal Name field. The value in the Internal Name field is used when Content Manager calculates the condition for publication.