Creating Templates
This guide walks you through creating a new template type from scratch.
Before You Start
Section titled “Before You Start”You’ll need:
- Access to the Templates folder
- Microsoft Word (or compatible app) for editing documents
- A text editor for
matter.json(or use any JSON editor)
Step 1: Create the Folder Structure
Section titled “Step 1: Create the Folder Structure”- Open your Templates folder in Finder
- Create a new folder with your template name (e.g., “Family Law”)
- Inside it, create a Precedents folder for documents
DirectoryTemplates/
DirectoryFamily Law/
DirectoryPrecedents/
- …
Step 2: Create matter.json
Section titled “Step 2: Create matter.json”Create a file called matter.json in your template folder. This file defines what information to collect.
Here’s a minimal example:
{ "version": "2.0", "name": "Family Law", "description": "Family law matters", "blocks": { "client": { "label": "Client Details", "fields": { "full_name": { "type": "text", "label": "Full Name", "required": true }, "address": { "type": "text", "label": "Address", "required": true }, "phone": { "type": "phone", "label": "Phone Number", "required": false } } }, "matter": { "label": "Matter Details", "fields": { "file_reference": { "type": "text", "label": "File Reference", "required": false }, "re_line": { "type": "text", "label": "Re: Line", "required": true, "help": "Brief description for folder naming" } } } }}Step 3: Define Default Folders
Section titled “Step 3: Define Default Folders”Add a defaultFolders section to create subfolders when a matter is created:
{ "version": "2.0", "name": "Family Law", "defaultFolders": [ "Correspondence/Incoming", "Correspondence/Outgoing", "Documents", "Court Documents", "Financial" ], "blocks": { ... }}Step 4: Create Document Templates
Section titled “Step 4: Create Document Templates”Now create Word documents with placeholders.
Placeholder Syntax
Section titled “Placeholder Syntax”Use double curly braces with the block and field name:
{{ client.full_name }}{{ client.address }}{{ matter.file_reference }}Example Letter Template
Section titled “Example Letter Template”[Your Firm Letterhead]
{{ client.full_name }}{{ client.address }}
Dear {{ client.full_name }},
Re: {{ matter.re_line }}
...
Yours faithfully,Save Documents
Section titled “Save Documents”Save your Word documents in the Precedents folder:
DirectoryFamily Law/
- matter.json
DirectoryPrecedents/
DirectoryLetters/
- Initial Client Letter.docx
- Costs Agreement.docx
DirectoryCourt/
- Application.docx
Step 5: Test Your Template
Section titled “Step 5: Test Your Template”- Open Certum Draft
- Go to Preferences → Templates
- Click Test Templates to validate
- Create a test matter to verify fields appear correctly
- Generate a test document to check placeholders work
Common Patterns
Section titled “Common Patterns”Standard Client Block
Section titled “Standard Client Block”Most templates use similar client fields:
"client": { "label": "Client Details", "fields": { "title": { "type": "select", "label": "Title", "options": ["Mr", "Mrs", "Ms", "Dr"], "required": false }, "given_names": { "type": "text", "label": "Given Names", "required": true }, "surname": { "type": "text", "label": "Surname", "required": true }, "full_name": { "type": "computed", "label": "Full Name" }, "street_address": { "type": "text", "label": "Street Address", "required": true }, "suburb": { "type": "text", "label": "Suburb", "required": true }, "state": { "type": "select", "label": "State", "options": ["NSW", "VIC", "QLD", "SA", "WA", "TAS", "NT", "ACT"], "required": true }, "postcode": { "type": "text", "label": "Postcode", "required": true } }}Date Fields
Section titled “Date Fields”For dates, use the date type:
"settlement_date": { "type": "date", "label": "Settlement Date", "required": true}In templates, you can format dates:
Settlement is scheduled for {{ matter.settlement_date | date("%-d %B %Y") }}Currency Fields
Section titled “Currency Fields”For money amounts:
"purchase_price": { "type": "currency", "label": "Purchase Price", "required": true}Troubleshooting
Section titled “Troubleshooting”Template doesn’t appear in the list
Section titled “Template doesn’t appear in the list”- Check that
matter.jsonexists and is valid JSON - Ensure the file is named exactly
matter.json - Try Preferences → Templates → Reload Templates
Placeholder shows [MISSING: field_name]
Section titled “Placeholder shows [MISSING: field_name]”- The field name in the document doesn’t match
matter.json - Check for typos and case sensitivity
- Ensure the field is defined in the correct block
Fields don’t show in the form
Section titled “Fields don’t show in the form”- Verify the field is in a
blockssection - Check that the JSON syntax is correct (no missing commas or brackets)
- Use a JSON validator to check for errors
Next Steps
Section titled “Next Steps”- Template Fields — All field types and options
- Matter Configuration — Complete matter.json reference