> ## Documentation Index
> Fetch the complete documentation index at: https://docs.melonly.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Template Editor

> Every setting in the record template editor: details, sections, fields, flags, matchers, and required fields.

***

## How the Editor Works

Open a template from [Records & Reports](/CAD/Admin/recordsreports#templates) to edit it. The Record Preview on the left shows the form exactly as users see it. Anything you type in the preview is saved as a default value.

Click **Save** when you're done. Layout changes apply to new records, but renaming a template also relabels existing ones.

***

## Template Details

| Setting | Description |
| - | - |
| Name | 1 to 48 characters. |
| Value font | Default font for values: Sans, Serif, or Mono. |
| Paper watermark | Diagonal text on paper view and PDF exports, up to 48 characters. |
| Form width | 4 to 8.5 inches. Click Edit & preview to see it at true size. |
| Form outer border | Draws a heavier border around the whole form. |
| Form search fill | Adds a search at the top that fills matching fields in every section. |
| Type | The record type. Civilian and BOLO templates can't change type. |
| Restrict Agencies | Only units in these agencies can create and edit records from this template. |
| DMV-only creation | Licence, Vehicle, and DMV Record only. Only the DMV panel can create these, not civilians. |

<AccordionGroup>
  <Accordion title="Charge options">
    Available on every type except BOLO and Warrant.

    | Option | Description |
    | - | - |
    | Don't Prosecute Charges | Charges can't be prosecuted. Use it for warnings. |
    | Don't Hold or Bond | Civilians aren't held or asked to bond for these charges. |
    | Summons | Non-criminal charges need a court date. |
    | Override prosecution deadline | Real days (0 to 365, 0 for none) to pay or request a hearing, instead of your [law setting](/CAD/Admin/law#configuration). |
  </Accordion>

  <Accordion title="Licence, Vehicle, DMV, and Civilian settings">
    | Setting | Applies to | Description |
    | - | - | - |
    | Expiration | Licence, Vehicle, DMV | How long it's valid, in RP days. 0 for no expiry on DMV records. |
    | Renewal Cost | Licence, Vehicle, DMV | Cost to renew once expired. |
    | Block renewal for unpaid tickets | Licence, Vehicle | Can't renew while a linked ticket is unpaid. |
    | Max Points | Licence | Points before the Max Points Action happens. |
    | Points Dropoff | Licence | How long points stay, in RP days. |
    | Max Points Action | Licence | Nothing, Revocation, File Court Hearing, or Suspension. |
    | Max Points Suspension Duration | Licence | Suspension length, in RP days. |
    | Default Balance | Civilian | Starting balance for new civilians. |

    RP days follow your [law time scale](/CAD/Admin/law#configuration). These settings also apply to existing records.
  </Accordion>

  <Accordion title="Discord webhooks">
    Save the template first, then click a row to set a Discord webhook URL and optional message text (up to 1800 characters).

    | Webhook | Sent when |
    | - | - |
    | All Record Events | Any event without its own webhook. |
    | Record Created / Edited / Deleted | A record is created, edited, or deleted. |
    | Warrant Requested / Approved / Closed | Warrant templates only. Needs its own webhook. |

    For call and unit events, see [Webhooks](/CAD/Admin/config/webhooks).
  </Accordion>
</AccordionGroup>

***

## Sections

Add sections with **Add new section** or **Add premade section**, and drag them to reorder. Every section has a name (up to 64 characters), border options, and can be duplicated or deleted.

<AccordionGroup>
  <Accordion title="Section types">
    | Section | Description |
    | - | - |
    | Standard | A blank section for your own fields. Can be duplicatable (users add more copies) and have its own search fill. |
    | Charges | Officers add charges from your [acts](/CAD/Admin/law/acts), including speeding charges. A speeding charge fills its wording, act, code, fine, and points from the chosen speeding class. |
    | Licence suspension | Suspends the first licence number on the form when filed. |
    | Speed | Older way to record zone, speed, and speeding class. Fine and points come from your [speeding classes](/CAD/Admin/law/speeding-surcharges#speeding-classes). New templates can use a speeding charge in a Charges section instead. |
    | Charges summary | Read-only totals of fine, jail, surcharges, points, and bond. |
    | Record link | Lets users link other records. |
  </Accordion>

  <Accordion title="Premade sections">
    | Section | Fields |
    | - | - |
    | Civilian Information | Photo, name, DOB, age, sex, alias, appearance, residence, contact number |
    | Report Header | Record #, Unit #, Agency, Division, Date, Unit Name, Badge # |
    | Report Footer | Status, Signature, Date, Description |
  </Accordion>

  <Accordion title="Charges section settings">
    | Setting | Description |
    | - | - |
    | Restrict Charges Acts / Types / Classes | Only allow certain acts, charge types, or classes. Empty allows all. |
    | Min Charges / Max Charges | 1 to 100. |
    | List-only charges | Officers must pick from the law list and can't change fines or jail time. |
    | Charge fields | Show, hide, rename, and style each charge column. |
  </Accordion>
</AccordionGroup>

### Dependencies

Click **Edit dependencies** on a section or field to hide it until fields in earlier sections match your rules. For example, show a DUI Details section only when Charge Type equals "DUI". Rules can require all or any to match, compare with Equal, Not Equal, or Contains, and only use text, number, and choice fields.

***

## Fields

Click **+ Add a new field** in a standard section.

<AccordionGroup>
  <Accordion title="Field types">
    | Type | Description |
    | - | - |
    | Text / Text Area | One line or several lines of text. |
    | Number, Date, Time, Address | A number, date, time or address. |
    | Record ID | The record's number. |
    | Checkboxes, Multiple Choice, Select Choice | Pick from a list of options (1 to 128 characters each). |
    | Image, Status | An image, or a status value. |
    | Label | Fixed text with no input. |
    | Random | A value generated from a format, such as a licence number. Needs at least 10,000 possibilities, so `####` is the shortest. |
  </Accordion>

  <Accordion title="Field settings">
    | Setting | Description |
    | - | - |
    | Label | Up to 96 characters. |
    | Input Mask / Format | Pattern users must follow: `L` letter, `#` digit, `N` letter or digit, `*` anything. For example `(###) ###-####`. |
    | Prefix / Suffix | Up to 4 characters before or after the value. |
    | Width / Offset | Width 1 to 16, offset 0 to 15. |
    | Matcher | What the field means, so Melonly can auto-fill and search it. See [Matchers](#matchers). |
    | Unique Type | Not Unique, Local (unique within this template), or Global (unique across the same matcher). |
    | Layout and styling | Border style, row height, date format, label and value alignment, bold, italic, and font. |
  </Accordion>

  <Accordion title="Flags">
    | Flag | Description |
    | - | - |
    | Required | Users must fill it in. |
    | Read-only | Users can't change it. |
    | Supervisor | Only panel supervisors can use it. |
    | Preview | Shows the value as a column in search results. |

    Required, Read-only, and Supervisor can't be combined, except a Random field can be required and read-only. A unique field can't be read-only.
  </Accordion>
</AccordionGroup>

### Matchers

Matchers link a field to other data, such as `first_name` or `veh_plate`. They power search fill, lookups, and [search indices](/CAD/Admin/recordsreports/search-indices). Use lowercase letters and underscores. See [Record Mappings](/CAD/Admin/recordsreports/record-mappings) for how they work in detail.

<Expandable title="Common matchers">
  | Area | Matchers |
  | - | - |
  | Civilian | `first_name`, `last_name`, `middle_initial`, `dob`, `age`, `alias`, `contact_number`, `residence` |
  | Vehicle | `veh_plate`, `veh_col`, `veh_make`, `veh_model`, `veh_type`, `veh_year`, `veh_exp`, `veh_iss` |
  | Licence | `licence_number`, `licence_status`, `licence_points`, `licence_exp`, `licence_iss`, `licence_class`, `licence_conditions` |
  | DMV | `dmv_iss`, `dmv_exp` |
  | Unit | `unit_id`, `unit_number`, `unit_agency`, `unit_division`, `unit_name`, `unit_rank`, `unit_platoon` |
  | Location | `unit_location`, `unit_street`, `unit_building`, `unit_postal` |
  | Charges | `charges_fine_subtotal`, `charges_fine_total`, `charges_points`, `charges_jail_total`, `charges_bond`, `charges_held_for_bond`, `charges_surcharge_*` |
  | Time | `now` |
</Expandable>

### Required fields

Some types need exactly one field with each of these matchers. Each must be required, not read-only, not hidden by a dependency, and not in a duplicatable section.

| Type | Required matchers |
| - | - |
| Civilian, Warrant, BOLO | `first_name` (Text), `last_name` (Text), `dob` (Date) |
| Licence | The above, plus `licence_number` (Text or Random) and `licence_iss` (Date) |
| Vehicle | `veh_plate` (Text), `veh_iss` (Date) |

***

<Card title="Need help?" icon="headset" href="https://melonly.xyz/discord">
  Still have questions? Join our Discord server for support from the Melonly Team.
</Card>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.