Automating Text Templates
Create and Insert Clauses Directly in Template
Insert a Clause Library into a Template
Edit an Existing Clause
Group Clause Components in One Custom Dialog
Understand How Clauses Work
When working with clauses and clause libraries, it is useful to understand the underlying
functionality. This includes understanding the files that control how clauses and clause
When you create a clause library and add clauses to it, HotDocs creates and uses the
Clause template file (.DOCX, .DOT, .RTF, .WPT): This is the file that contains the
text of the clause component. When you create a clause template file, HotDocs
generates an eight-character file name based on the clause component name,
appends the appropriate file name extension, and adds the clause to an archive
file (see below). (If the clause name is less than eight characters, HotDocs adds
underscores to make the template name the right length.)
Clause component file (.CMP): When you create a clause, HotDocs creates a
clause component, which is added to a component file. Where you create the
clause determines which component file is used. For example, if you create
clauses at a template, the clause components are added to the template's
component file. But if you create clauses at a clause library, HotDocs creates a
new component file that is associated with the clause library and stores the clause
components in it.
In addition to storing the clause components, the clause component file also stores
other components used in the clause text, such as variables, dialogs, and scripts.
Clause library file (.HDL): This is a library file that contains an organized set of
shortcuts that correspond to a set of clauses stored in the HotDocs clause archive
file (see below). The clause library file gets its name based on where it is
created—either at the template or at a template library. For example, if you create
a clause library while editing contract.rtf, the clause library file name becomes
contract.hdl. However, when you create a clause library at a regular template
library, you specify the file name.
Clause Archive file (.HCL): This is a file that contains a set of related clauses in
compressed (or zipped) format. When you edit or assemble a document using
clauses, this file is unzipped and the clause template files are extracted on an as-
needed basis to a temporary folder. When the clauses and clause library are no
longer in use, the clause template files are zipped and saved to the clause archive
file, and all temporary files are deleted.
These files work simultaneously to organize and store clauses. The clause library file, the
clause template file, and the clause component file are all located in the word processor's
template folder, along with the other HotDocs templates.