Conditions and condition sets
The Condition and ConditionSet elements in designmap.xml, AppliedConditions on a run, and ConditionalTextPreference — spelled the way InDesign reads them.
A Condition is a named switch in the design map; a run names the switches that govern it in AppliedConditions.
In short Conditions are direct children of Document in designmap.xml. Each
Condition has a Self id, a Name, a Visible flag and an on-screen indicator whose
colour is a typed IndicatorColor property. A ConditionSet stores a saved combination
of visibilities as <Properties><SetConditions> with one VisibilityPair per
condition. A ConditionalTextPreference follows them. In a story, a
CharacterStyleRange lists the conditions that govern it, space-separated, in
AppliedConditions.
One hidden condition in the design map and a run that names it: the run is in the story and does not print.
Condition
A Condition is a direct child of Document in the design map. InDesign 20.0.1 reads
conditions there, before the idPkg:Preferences reference or after the layers.
Conditions wrapped in a RootConditionalTextGroup element in Resources/Styles.xml, a
spelling some generated files use, are invisible to InDesign.
Selfis the id a run names, conventionallyCondition/<name>.Nameis the name shown in InDesign's Conditional Text panel.Visible="false"hides every run that names the condition.IndicatorMethodis how the condition is marked on screen; InDesign writesUseHighlight.- The indicator colour is a typed property,
<Properties><IndicatorColor type="enumeration">Red</IndicatorColor></Properties>. AnIndicatorColorattribute is ignored.
| Attribute · Condition | Values | Paged | paged.set |
|---|---|---|---|
| IndicatorMethod | enum | read · written | |
| Name | enum | read · written | |
| Self | reference | read · written | |
| Visible | bool | read · written | visible |
The indicator marks the text while editing. Whether it shows, and whether it prints, is
set document-wide in ConditionalTextPreference.
AppliedConditions on a run
A CharacterStyleRange names its conditions in AppliedConditions, a space-separated
list of Condition ids such as "Condition/Print Condition/Draft". A range without the
attribute is not conditional. A run with one condition prints when that condition is
visible and is left out when it is hidden. What happens to a run with several
conditions, some visible and some hidden, is covered in
visibility.
| Attribute · CharacterStyleRange | Values | Paged | paged.set |
|---|---|---|---|
| AppliedConditions | ref | read | appliedConditions |
ConditionSet
A ConditionSet is a named, saved combination of condition visibilities, the kind an
author switches between ("Print edition", "Web edition"). It is a direct child of
Document, after the conditions. Its contents are a typed list:
<Properties><SetConditions> holding one
<VisibilityPair Condition="Condition/…" Visibility="true"/> per condition, each pairing
a condition with the visibility the set gives it.
A space-separated Conditions="a b" attribute on ConditionSet, another generated-file
spelling, is ignored by InDesign, and a set written that way silently captures every
condition in the document.
| Attribute · ConditionSet | Values | Paged | paged.set |
|---|---|---|---|
| Self | reference | read · written | |
| Name | text | read · written |
ConditionalTextPreference
One ConditionalTextPreference follows the conditions in the design map.
ShowConditionIndicators controls the indicators; with ShowIndicators, the only value
in the census, they appear on screen and do not print. ActiveConditionSet names the
set currently applied, or n for none. All 271 InDesign-exported documents in the
census carry it, with no set active.
| Attribute · ConditionalTextPreference | Values | Paged | paged.set |
|---|---|---|---|
| ActiveConditionSet | — | written | |
| ShowConditionIndicators | ShowIndicators | written |
In Paged: conditions and sets are read from the design map and, for older files, from
Styles.xmlin either spelling; saving writes InDesign's spelling. A condition id that names noConditioncounts as visible. A set'sVisibilityPairs are read as its members, whatever theirVisibilityvalue, and the active-set preference is not read. Scripts can show or hide a condition, or activate a set, which shows its members and hides every other condition. Supported · verified
Frequently asked questions
Where are conditions defined in an IDML file?
In designmap.xml, as direct children of Document. InDesign does not see conditions
placed inside a RootConditionalTextGroup in Styles.xml.
How is a condition's indicator colour written?
As a typed property: <Properties><IndicatorColor type="enumeration">Red</IndicatorColor></Properties>.
The attribute form is ignored.
How does a run name more than one condition?
With a space-separated list in AppliedConditions, for example
"Condition/Print Condition/Draft".
How does a condition set list its conditions?
As VisibilityPair elements inside <Properties><SetConditions>, one per condition,
each with Condition and Visibility attributes. A Conditions attribute is ignored.
Does the condition indicator print?
Not with ShowConditionIndicators="ShowIndicators", the value in every census document:
the indicator then appears on screen only.
Conditional text
How one IDML document carries several versions of its text — named conditions in the design map, runs that name them, and when their text is left out.
Visibility
When conditional text prints — a run under a hidden condition, a run under several conditions (shown while any is visible), sets and indicators.