---
title: Edit a template
project: OpenTemplates
version: 1.0
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/opentemplates/1-0/guides/template-editor/
updated: 2026-11-19T07:56:20.546Z
---

# Edit a template

> Write the HTML of a template with a live preview.

Click a template card, or choose **Update template** in its menu, to open the editor. The HTML is on the left and the preview, already inside the profile [layout](../layouts/), is on the right. The preview changes while you type.

![The template editor with the HTML of an invoice and its preview](/files/JapW2d56Y61f.webp)

Click **SUBMIT** to save the template. **Cancel** closes the editor without saving.

## Preview with sample data

The preview fills the template with the sample model you put in a `<script type="text/json">` block at the end of the template. In the example above, the model holds an invoice number, a customer and two items. Your apps send their own data when they render; the sample model only feeds the preview. See [Template syntax](../template-syntax/).

## Insert a date, a GUID or a file

Right-click in the HTML to open the editor menu.

![The editor menu with Upload file, Insert current date and Insert GUID](/files/JapW2f57Y60f.webp)

- **Upload file**: upload an image or another file and insert its address. See [Images and files](../files/).
- **Insert current date**: insert the current date and time, for example `"2026-11-19T07:30:00.000Z"`.
- **Insert GUID**: insert a random unique ID.
