Conditions
Conditions
Conditions are used to filter content. Conditions can be applied to content using the <condition> element, or applied using the @condition attribute for Typefi Sections (<section>), tables (<table>), and Typefi Elements (<context>). Conditions can exist both inside and outside paragraphs.
New in CXML 3.4
<condition> now supports @author and @dateTime.
<condition> has five attributes:
| Attribute | Value | Description |
|---|---|---|
| type | string | Required. The type of condition. |
| id | string | The unique ID of the condition. |
| status | added changed deleted | Indicates the modification status of the conditional content. |
| author NEW | string | The author of the tracked change. |
| dateTime NEW | ISO 8601 datetime string | The date and time of the tracked change (2024-01-09T14:37:00Z). |
Conditional content using the <condition> element and using the @condition attribute:
<section type="Questions">
<condition type="US">
<p>Analyze this:</p>
</condition>
<condition type="UK">
<p>Analyse this:</p>
</condition>
<p>
1. What is your
<condition type="US">favorite color</condition>
<condition type="UK">favourite colour</condition>
?
</p>
</section>
<section type="Answers" condition="TeacherEdition">
<p>1. Red!... I mean blue!</p>
</section>A condition with tracked changes:
<section type="Questions">
<condition type="US" status="added" author="John Cleese" dateTime="1975-04-05T09:00:00Z">
<p>Analyze this:</p>
</condition>
<condition type="UK" status="added" author="John Cleese" dateTime="1975-04-05T09:00:00Z">
<p>Analyse this:</p>
</condition>
</section>Conditional list items
The <condition> element can be used inside <ol> and <ul> to apply conditions to groups of list items.
New in CXML 3.4
<condition> in list context now supports @author and @dateTime.
<condition> has five attributes in list context:
| Attribute | Value | Description |
|---|---|---|
| type | string | Required. The type of condition. |
| id | string | The unique ID of the condition. |
| status | added changed deleted | Indicates the modification status of the conditional list items. |
| author NEW | string | The author of the tracked change. |
| dateTime NEW | ISO 8601 datetime string | The date and time of the tracked change (2024-01-09T14:37:00Z). |
Conditional list items:
<ol>
<condition type="US">
<li><p type="List Number">Analyze this</p></li>
</condition>
<condition type="UK">
<li><p type="List Number">Analyse this</p></li>
</condition>
</ol>Conditional list items with tracked changes:
<ol>
<condition type="US" status="added" author="John Cleese" dateTime="1975-04-05T09:00:00Z">
<li><p type="List Number">Analyze this</p></li>
</condition>
<condition type="UK" status="added" author="John Cleese" dateTime="1975-04-05T09:00:00Z">
<li><p type="List Number">Analyse this</p></li>
</condition>
</ol>