Skip Ribbon Commands
Skip to main content
In ContactsLaw, the document template editor is the mechanism used to create and edit document templates.
 
Document template editor
 
It supports two different approaches for creating templates:
  1. Adapt an existing Word/Outlook/etc template file for use in ContactsLaw.
    With this approach, you create or modify a template using an external application (such as Microsoft Word), leaving placeholder fields in the document. When finished, you upload the file to ContactsLaw and map the fields using the editor screen (optionally applying formatting).

  2. Create a new template from scratch using ContactsLaw's in-place editing features.
    Where supported by a particular template format (e.g. Word, Outlook), you can create a new, blank template in ContactsLaw and then open it for editing. ContactsLaw-specific tools are made available from within the external application; these simply the task of adding placeholder fields and give you the ability to map them onto ContactsLaw fields while you work. When you check in your changes, all mappings and formatting are updated within the editor.
Regardless of the approach, the template editor uses the same basic concepts:

Template properties

The properties of a template determine its characteristics, behaviour and the fields available to it:
  • Workgroup - Controls which roles and fields from the file will be available, as well as determining where the template belongs.
  • Document type - Determines which properties of the resulting document are available to the template.
  • Control type - Causes ContactsLaw to use the template for a particular purpose, e.g. whenever a template for an outgoing e-mail is needed.
  • Default folder - Determines which folder new outgoing documents are placed in (default is the folder associated with the document type).
  • Subject - Allows the 'original subject/description' text to be overridden when building the description of the document.
  • Related product - Determines the product to which the document relates (for billing purposes).
  • Visibility - Controls whether the template appears in the list. Set templates to inactive when they are no longer in use.
  • Contact fields - Templates can provide a simple set of fields for basic templates, an intermediate set for most uses, or a comprehensive set for advanced users.
  • Relationships - Contact relationship types can be added to the template to expose even more fields.

Template document and placeholder fields

In order to dynamically insert data, the document that forms the basis for the template must contain placeholder fields (in addition to static text and markup). ContactsLaw builds documents by making a copy of the template document and subsituting the placeholder fields for their actual values (as determined by the mappings, formatting rules, file, contacts and document properties).
 
The nature of the placeholder fields depends on the document format; different programs use different mechanisms. Once uploaded or checked-in, ContactsLaw will inspect the template document for these placeholders and populate the list accordingly. If placeholders are removed or changed, this will also be detected.

ContactsLaw fields

The fields which can be mapped onto the placeholders in a template represent global and contextual information that can be drawn upon in order to build documents. The list of available fields varies, according to factors such as the document type, workgroup selection, level of complexity and contact relationships. The fields draw data from (among other sources):
  • Properties of the document (contacts, dates, description, enclosures, etc; added during document creation)
  • The file (specified during document creation), including its cost estimate, distribution list, contacts, representatives and workgroup fields
  • The practice (or subsidiary company active during document creation), including bank account details
They are arranged in a hierarchical fashion; with the main sources of data at the top, subsections and related sources below, and the fields themselves at the bottom. The tree exhibits a degree of self-similarity, in so far as that each type of contact contains the same set of fields, which may in-turn contain related contacts.
Field mappings are expressed in the form: Group.SubGroup.Field . Most fields are accompanied by documentation and a sample value (which can be used to preview formatting). Some also contain default formatting rules (e.g. dates assume the practice default date format).

Fields, results and values

ContactsLaw uses several terms to refer to the data that builds the document:

  • A field (as described above) is the path to the information that will be retrieved from the database.
  • Depending on where the field draws its information from, it may yield results from zero, one or multiple contacts/documents/records. For example: 
    • On a file with 3 defendants, the field File.Parties.Defendant.Names.FullName will yield 3 results.
    • If each of the 3 defendants has 2 telephone numbers, the field File.Parties.Defendant.Communications.Telephone.Number will yield 6 results.
  • ContactsLaw will retrieve the value stored in the requested field for each of the results. In the example stated above, the values are the 3 contacts' names.

Thus, a field may produce several values for insertion into the document. However; unless you specify how these will be handled (see Rules and formatting below), ContactsLaw will simply take the first value produced by each field. On the final screen of the document creation wizard, you will be able to select which of the values will be inserted into each placeholder field.

An empty value occurs when the field draws upon information from one or more valid records, but the value in that particular field is blank. It is important to understand the difference between an empty value and a field that yields no results.

Composite fields

While the simplest way to construct a template is to map each placeholder field onto one of the available fields in ContactsLaw, it is possible to construct more advanced templates by mapping multiple (usually related) fields onto a single placeholder in the template. This offers the advantage of being able to construct phrases or sentences, or create a table structure within the template. (Since fields span left to right, composite mappings are the only way to define columns which fill downwards.)

Rules and formatting

Formatting rules are a powerful mechanism which can be used to dramatically change the way that data is presented in the resulting document. The rules can be grouped into the following basic types:
  • Rules which format the values for display; e.g. character casing, date and telephone number formats, etc
  • Rules which add to the values; e.g. prefix, suffix
  • Rules which change the values depending on a condition; e.g. replace empty/non-empty, substitute
  • Rules which determine how to handle multiple values; e.g. use first value, join together, replace based on number of results
With formatting rules, even you can create fields which do not display the value they are mapped to; instead, examining the value and producing different output depending on some condition. (For example, you might map a field to the name of a contact in the 'carbon copy' role. If there is a contact in that role, you can display one piece of text; if not, another.)
 
formatting-rules.jpg
 
The formatting rules editor presents you with a list of available rules. When adding a rule, you enter any arguments to the rule; some rules allow you to choose from a list of behaviours (e.g. phone number formats), others accept text input (e.g. text replacement). The rules are evaluated in order, and you can re-order items in the list to affect the output. A preview is displayed at the bottom of the screen, showing you the result after the rules have been applied.
 
For rules on composite fields, you can apply formatting to each component of the field, or to the field as a whole. You can enter example values for each component to preview the output. You can also use the 'advanced' preview feature to test the behaviour when the field has multiple results.

Optional sections

With some types of document templates, it's possible to define sections within the document that can be toggled on and off, according to certain conditions. The method for defining such sections depends on the type of document (see the how-to article below). Each defined section appears under the 'optional sections' tab. Optional sections operate in much the same way as placeholder fields; you map one (or more) ContactsLaw fields onto them and set the rule that governs whether the section is displayed or not (for example, if multiple clients exist on the file, you may include an additional paragraph).

Related documents

Often, covering letters/e-mails are created for the purpose of sending existing documents. For such documents, you can build criteria for automatically populating the list of enclosures for documents created from a template. You can include documents on the file in the following ways:

  • Specific document - Enter the number of a document which is always enclosed (such as a brochure or set of terms and conditions).
  • Workgroup field - For workgroup fields which accept a document number, you can include the document(s) entered into that field on the file. You can only reference fields which belong to the workgroup in which the template resides.
  • Document type - All documents with a particular document type can be included. You can only reference document types which are either global or belong to the workgroup in which the template resides.

If a particular set of criteria produces no enclosures, it will be ignored. You can also specify a set of conditions (drawing upon information from the file or document at the point of creation) to control whether a particular enclosure is added.

In this section, you can also specify stationery to use when converting the document to PDF.

Fragments

Depending on the format of the template, you may be able to embed fragments in the main document. You must create placeholders in the body of the document to indicate where the content will be inserted (these placeholders differ from the placeholders for ordinary fields). After reloading the fields, you will be able to assign a fragment to each placeholder.
 
​Note: Fragments should be of the same document type and workgroup (or available in all workgroups) as the templates they are inserted into.

Snippets

Snippets are a feature that allows you to maintain a collection of frequently-used field mappings and formatting rules, which you can reuse across different templates. You can assign descriptive names and arrange snippets into groups. You can export all or part of your collection and share your snippets with other members. Note that snippets are stored locally on the client computer and are not transferred when changing computers.

See also