paged.IDML Reference
Conditional text

Conditions and condition sets

The Condition and ConditionSet elements in designmap.xml, AppliedConditions on a run, and ConditionalTextPreference — spelled the way InDesign reads them.

Tier: ProProIIIreference

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.

designmap.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?aid style="50" type="document" readerVersion="6.0" featureSet="257" product="20.0(32)"?>
<Document xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="20.0" Self="d" StoryList="ustory" Name="conditional-run.indd" CMYKProfile="Coated FOGRA39 (ISO 12647-2:2004)" RGBProfile="sRGB IEC61966-2.1" SolidColorIntent="UseColorSettings" AfterBlendingIntent="UseColorSettings" DefaultImageIntent="UseColorSettings">
  <idPkg:Graphic src="Resources/Graphic.xml"/>
  <idPkg:Fonts src="Resources/Fonts.xml"/>
  <idPkg:Styles src="Resources/Styles.xml"/>
  <Condition Self="Condition/Draft" Name="Draft" IndicatorMethod="UseHighlight" Visible="false">
    <Properties>
      <IndicatorColor type="enumeration">Red</IndicatorColor>
    </Properties>
  </Condition>
  <ConditionalTextPreference ShowConditionIndicators="ShowIndicators" ActiveConditionSet="n"/>
  <idPkg:Preferences src="Resources/Preferences.xml"/>
  <idPkg:Tags src="XML/Tags.xml"/>
  <idPkg:MasterSpread src="MasterSpreads/MasterSpread_umaster.xml"/>
  <idPkg:Spread src="Spreads/Spread_uspread.xml"/>
  <idPkg:Story src="Stories/Story_ustory.xml"/>
  <idPkg:BackingStory src="XML/BackingStory.xml"/>
</Document>

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.

  • Self is the id a run names, conventionally Condition/<name>.
  • Name is the name shown in InDesign's Conditional Text panel.
  • Visible="false" hides every run that names the condition.
  • IndicatorMethod is how the condition is marked on screen; InDesign writes UseHighlight.
  • The indicator colour is a typed property, <Properties><IndicatorColor type="enumeration">Red</IndicatorColor></Properties>. An IndicatorColor attribute is ignored.
Attribute · ConditionValuesPagedpaged.set
IndicatorMethodenumread · written
Nameenumread · written
Selfreferenceread · written
Visibleboolread · writtenvisible
The 4 attributes real documents use most. All 4 attributes of Condition →

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 · CharacterStyleRangeValuesPagedpaged.set
AppliedConditionsrefreadappliedConditions
Selected attributes. All 57 attributes of CharacterStyleRange →

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 · ConditionSetValuesPagedpaged.set
Selfreferenceread · written
Nametextread · written
Selected attributes. All 3 attributes of ConditionSet →

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 · ConditionalTextPreferenceValuesPagedpaged.set
ActiveConditionSet—written
ShowConditionIndicatorsShowIndicatorswritten
The 2 attributes real documents use most. All 2 attributes of ConditionalTextPreference →

In Paged: conditions and sets are read from the design map and, for older files, from Styles.xml in either spelling; saving writes InDesign's spelling. A condition id that names no Condition counts as visible. A set's VisibilityPairs are read as its members, whatever their Visibility value, 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.

On this page