Fields
Typefi Fields
Typefi Fields are specialized containers for meta-information about Typefi Projects Fields, Section Fields, and Element Fields. All three types of Typefi Fields are set with the <fieldSet> element.
Project Fields are set with <fieldSet> directly under a content (<content>) element.
Section Fields are set with <fieldSet> directly under a Typefi Section (<section>). Section Fields can be either text-based or counters. If the latter, the value attribute for <fieldSet> is omitted.
Element Fields are text-based and are set with <fieldSet> directly under a Typefi Element (<context>).
<fieldSet> has three attributes:
| Attribute | Value | Description |
|---|---|---|
| id | string | The unique ID of the Typefi Field. |
| name | string | Required. The name of the Typefi Field. |
| value | string | The value of the Typefi Field. |
Two Project Fields and a Section Field:
<content>
<fieldSet name="Title" value="The Meaning of Life" />
<fieldSet name="Author" value="Monty Python" />
<section type="Sketch">
<fieldSet name="ChapterTitle" value="The Miracle of Birth" />
<p>What is the meaning of life?</p>
</section>
</content>Typefi Field Instances
A Typefi Field Instance (<fieldRef>) is a text variable in your content that represents the value of a Typefi Field. Field Instances do not roundtrip through InDesign.
The reference ID (@refId) attribute allows <fieldRef> to point to a <fieldSet> in a different section or element.
Cross-reference Typefi Fields: You can reference Typefi Fields (<fieldSet>) from any Typefi Section (<section>) or Typefi element (<context>) by pointing to the associated ID (or @refId) within a Typefi Field instance (<fieldRef>).
<fieldRef> has five attributes:
| Attribute | Value | Description |
|---|---|---|
| name | string | Required. The name of the Typefi Field you are referencing. |
| refId | string | The unique ID of the section or element that contains the referenced <fieldSet> . |
| status | added changed deleted | Indicates the modification status of the Typefi Field. |
| author | string | The author of the tracked change. |
| dateTime | ISO 8601 datetime string | The date and time of the tracked change (2024-01-09T14:37:00Z). |
A Field Instance:
<content>
<fieldSet name="year" value="1983"/>
<section>
<context>
<p>Monty Python's The Meaning of Life (<fieldRef name="year"/>)</p>
</context>
</section>
</content>
<!-- Resolves to: -->
<content>
<fieldSet name="year" value="1983"/>
<section>
<context>
<p>Monty Python's The Meaning of Life (1983)</p>
</context>
</section>
</content>Cross-reference using @idand @refId:
<section type="Page 2" id="001">
<fieldSet name="year" value="1983"/>
</section>
<content>
<section>
<context>
<p>Monty Python's The Meaning of Life (<fieldRef name="year" refId="001"/>)</p>
</context>
</section>
</content>
<!--Resolves to-->
<content>
<section>
<context>
<p>Monty Python's The Meaning of Life (1983)</p>
</context>
</section>
</content>Cross-reference with tracked changes:
<content>
<section>
<context>
<p>Monty Python's The Meaning of Life (<fieldRef name="year" status="added" author="Eric Idle" dateTime="1983-06-09T09:00:00Z"/>)</p>
</context>
</section>
</content>