Spanish Total.js
English
Documentation For AI agents
Contents

Templates

Questions about writing and calling templates.

.md GitHub
On this page

What is the template ID?

The profile identifier and the template identifier joined with a slash, for example demo/invoice. It is shown on every template card; click it to copy it.

Why does a value in my template come out empty?

The field is missing in the data your app sends, or its name differs. Field names are case-sensitive. Compare the data with the sample model of the template. See Template syntax.

Why do I see <b> instead of bold text?

Values are HTML-encoded. Write {{ value.note | raw }} for a value that holds HTML you trust.

Where do I put styles?

Put shared styles in the layout of the profile, and styles for one document in its template.

Does the preview look exactly like the output?

The template and the data are rendered the same way. The default layout adds a grey background and an A4 sheet only in the preview, with {{ if $.preview }}.

Can two profiles use the same template identifier?

  1. The template ID includes the profile identifier, so demo/welcome and letters/welcome are different templates.
Made in Europe