Marker Fields Overview
A Marker Field is a type of HotDocs field that tells HotDocs how to format and punctuate text in a template. For example, a bold formatting marker field enables you to apply a bold format to text.
Overview
Marker fields enable you to format text and insert punctuation in your HotDocs template. You can use marker fields with answer placeholder fields, text in interview components, and the text in your document. There are three types of marker fields:
- Formatting markers — enable you to change the character style and capitalization of text
- Punctuation markers — enable you to apply text insertions, punctuation marks and breaks in your text
- List punctuation markers — enable you to punctuate a non-repeated list of items
You add formatting markers through the Field Editor, either when editing a template or when working in Component Studio.
Formatting markers and list punctuation markers have beginning tags and ending tags. The range of text between the beginning tag (in this example, [.b]) and ending tag (in this example, [.be]) is the text that HotDocs will bold. For example, if you select the bold formatting marker field, the marker field surrounds the text you highlight with the following tags:
[.b]Your bolded text here[.be]
Once inserted, you can also move the beginning and ending tags using cut and paste commands.
Marker fields are particularly useful when you need to format text generated by computations. The text produced from a computation is plain text, which cannot have formatting applied to it directly. If you want text from a computation to be formatted when it is inserted into an assembled document, you must use formatting markers inside the computation script to format the output text. For example:
RESULT + "«.b»This text is bold«.be»"
Common Tasks
Among others, marker fields enable you to do the following tasks:
- Adding formatting marker fields
- Adding punctuation marker fields
- Punctuating a non-repeated lists of answers
Using Marker Fields in Your DOCX Template
You will often need to ensure answer data that appears in an assembled document is formatted a certain way. For example, that a company name is displayed in bold. You do this by applying an appropriate marker field to the text or variable placeholder fields in your template. For example, you can use the bold formatting marker to make the company name bold when it appears as text:
[.b]J. Smith and Sons, Ltd[.be]
Or you can bold the company name when it appears as a variable placeholder field:
[.b][CompanyName][.be]
When a user assembles the template, HotDocs processes the marker fields and applies the formatting to the answer data that replaces the placeholder field.
See Adding Formatting Marker Fields for more information.
If a multiple-choice or True/False variable prompt contains a formatting marker, and the variable is set to appear either as option buttons or check boxes, HotDocs does not format the prompt text.
Using Marker Fields in Interview Components
You can use component studio's own Field Editor to add marker fields to HotDocs components. Marker fields in HotDocs components format the text that appears in the interview. This includes:
- Variable prompts
- Dialog element text
- Additional information
- Text generated by computation scripts
For example, you can bold the prompt text for a variable component:
Please provide a fax number for «.b»Widgets & Things, Co.«.be» if applicable
Or you can bold a variable placeholder field when it appears in a prompt:
Please provide a fax number for «.b»«CompanyName»«.be» if applicable
If a multiple-choice or True/False variable prompt contains a formatting marker, and the variable is set to appear either as option buttons or check boxes, HotDocs does not format the prompt text.
Punctuate Non-Repeated Lists
You can use marker fields to merge punctuation for non-repeated lists in the template. Using a series of list marker fields, you define where punctuation marks should be used to separate items in a list. Additionally, you can define the conjunction (for, and, nor, but, or, yet, so) used in the list. This is useful when you have separate answers that are being placed conditionally in list format.
The following is an example of how list marker fields can be used in the text of a template.
The list punctuation marker — [.p "a, b, and c"] — appears first, indicating the start of the list, punctuation format, and conjunction the list should use. The list separator marker — [.p] — follows each item in the list, indicating where the punctuation is. The end list — [.pe] — indicates the end of the list:
[.p "a, b, and c"]The client's family consists of [Client Name][.p][IF Client is Married]spouse [Spouse Name][.p][END IF][IF Client Has Children]children [REPEAT Children:a, b, and c][Child Name][END REPEAT>][.p][END IF][.pe].
In this example, there are really two lists:
- The list of family members (client, spouse, and children)
- The list of individual children
While list marker fields are used to punctuate this first list, the repeat format for the REPEAT instruction punctuates the list of children. However, you can use a list marker fields to punctuate the items in a REPEAT instruction, as well. The following script demonstrates how to nest these marker fields:
[.p "a, b, and c"]The client's family consists of [Client Name][.p][IF Client is Married]spouse [Spouse Name][.p][END IF][IF Client Has Children][.p "a, b, and c"]children [REPEAT Children:a, b, and c][Child Name][END REPEAT>][.pe][.p][END IF][.pe].
Common Reference Topics
Among others, the following reference topics may relate to this conceptual area: