---
title: Edit a document
description: >-
  Edit a Smart Document in the TipTap editor: insert variables, preview as a
  user, save to publish versions, and restore earlier ones.
sidebar:
  order: 2
---

**Editing a smart document** happens in the TipTap editor. Open it from the ⋯ menu of a template on **Settings → Communication & Documents → Documents** by choosing **Edit**. There you write the text, insert variables and form fields, check the result in preview, and publish a new version with **Save**.

:::tip
Use **Preview** with a real user before every save. Variables, conditions, and smart tables show real data, so gaps are easy to spot.
:::

## Why it matters

The editor is where a template becomes a usable document. Careful editing prevents blank fields, wrong wording, and layouts that break across pages when you generate documents for many people.

## Before you start

| Requirement | Detail |
|---|---|
| **Feature** | **Smart Documents** in the FuxamCMS package. |
| **Permission** | `read-write:settings-service-contracts`. |
| **Template** | An existing template. Create one first if you have none. |
| **A test user** | For User templates, a user whose profile has typical data. For Module templates, a module version. |

## The editor at a glance

| Area | What it does |
|---|---|
| **Document title** (top left) | Rename the document in place. An autosave indicator shows "Saving..." and "Saved". |
| **As user:** / **Choose user** | Pick the user whose data fills variables in preview. Module templates show a module picker instead. |
| **Preview** toggle | Switch between editing and preview. A banner says "You are in preview mode now." |
| **Versions** | Lists saved versions, marks the **Current** one, and lets you **Restore** an older one. |
| **Save** | Checks the document, publishes it as a new version, and returns you to the Documents settings. |
| ⋯ **More actions** | **Show schema**, **Import from Word**, and **Print preview**. |
| Toolbar | Undo, Redo, Bold, Italic, Underline, lists, alignment, **Insert**, text color, font size, block format, font family, **Show sample data**, Zoom, and **Page setup**. |

## How to edit a document

1. Go to **Settings → Communication & Documents → Documents** and open the ⋯ menu of the template. Choose **Edit**.

2. Write and format the text. Use the toolbar for headings, lists, alignment, and fonts.

3. Open **Insert** to add content: **Variable**, **Form elements**, **Smart table**, **Table**, **Image**, **Page break**, **Conditional section**, or **Signature**. In the text you can also type `/` for the block menu or `@` for variables.

4. Open **Page setup** to set format, orientation, margins, header and footer, and page numbering.

5. Choose **Choose user** (or a module) and turn on **Preview**. Check every variable, condition, and table. Use **Print preview** from ⋯ **More actions** to see the page as a PDF.

6. Select **Save**. Fuxam checks the document and then publishes it as a new version. If the check fails, the message "Save blocked" (or "Publish blocked") asks you to fix smart table data sources and embedded fonts first. Fix those and try again.

To bring in more Word content later, use ⋯ **More actions → Import from Word**. Choose **Insert at cursor** or **Replace document**.

To go back to an earlier state, open **Versions** and choose **Restore** next to the version. A "Version restored" message confirms it.

:::info
Templates created before the TipTap editor are **PDF** templates. **Edit** opens the older PDF editor for them. This page describes the TipTap editor.
:::

## Best practices

- **Preview with more than one user.** Check one user with full data and one with gaps.
- **Set "When empty" on variables.** Choose **Hide**, a dash, or **Fallback text** so gaps never look like errors.
- **Use conditional sections for optional text.** Add a rule instead of keeping several near-identical templates.
- **Set up the page before you polish text.** Margins and headers change where pages break.
- **Save before you leave.** Autosave protects your draft, but **Save** creates the version people will use.

## Common pitfalls

| Pitfall | How to avoid it |
|---|---|
| Typing a value that should be a variable | Insert a **Variable** so it changes per user. |
| Only checking one user | Preview several users. |
| Ignoring "Save blocked" | Fix smart table data sources and embedded fonts, then save again. |
| Restoring the wrong version | Check the version number and **Current** label in **Versions** first. |
| Expecting Word layout after import | Only text structure is kept. Rebuild layout in the editor. |

## FAQ

**Does autosave publish my changes?**

Autosave keeps your draft safe while you work. Only **Save** publishes the document as a new version that people can use.

**Can I undo a save?**

Yes. Open **Versions** and restore an earlier version.

**Can I rename a template without opening the editor?**

Yes. Use **Rename** in the ⋯ menu of the templates table. See [Manage documents](/docs/fuxam-web/cms/smart-documents/manage-documents).

**Why do I see no data in preview?**

The chosen user or module has no data for that variable. Choose another user, or check the data in [User Management](/docs/fuxam-web/base/user-management).

## Related pages

**[Document variables and data sources](/docs/fuxam-web/cms/smart-documents/document-variables-and-data-sources)**

Variables, formats, and smart tables.

**[Use a document template](/docs/fuxam-web/cms/smart-documents/use-a-document-template)**

Generate documents for users.

**[Manage documents](/docs/fuxam-web/cms/smart-documents/manage-documents)**

Rename, set default, and delete templates.

**[Create a document](/docs/fuxam-web/cms/smart-documents/create-a-document)**

Add a new template.
