Docs

TEMPLATING

Documentation
Back

TEMPLATING

What is this for?

With TEMPLATING you manage templates (e.g., for contract PDFs).

A template defines:

  • Which text appears where (salutation, clauses, terms and conditions)
  • Which data fields are inserted (tenant name, contract number, inventory list, etc.)
  • Optionally: special inventory rows / layout building blocks

Currently, templating is mainly geared toward VERTRAG PDFs, but it can be used for further templates as they are added.


Common tasks (day-to-day)

  • Create a template
  • Mark a template as default
  • Preview a template
  • Manage multiple variants (e.g., "Contract German" vs. "Contract English")

Step by step

1) Open the template list

  • Admin → Templating (/settings/admin/templating).

2) Create a new template

1. "New" (/settings/admin/templating/new).
2. Fill in the fields:

  • Name
  • Type (e.g., contract)
  • Body / HTML with placeholders

3. Save (POST /settings/admin/templating).

> Available placeholders depend on the type. Example for contract: {{vertrag.id}}, {{mieter.name}}, {{inventar}}. If you are unsure, use the preview.

3) Edit a template

  • Open the entry (/settings/admin/templating/{id}/edit) → save (POST /settings/admin/templating/{id}).

4) Mark a template as default

  • For each type, exactly one template can be marked as default.
  • POST /settings/admin/templating/{id}/default.
  • This template is used when generating a PDF if no other one is selected.

5) Delete a template

  • POST /settings/admin/templating/{id}/delete.
  • Default templates cannot be deleted without first choosing a different one as default.

6) Preview

  • POST /settings/admin/templating/preview with sample data — shows how the finished document would look with the template, without producing an actual PDF.

Common questions / problems

"My placeholder is not replaced"

  • Check the spelling (brackets, dots, casing).
  • The value may be empty (e.g., a tenant without a phone number).

"The PDF looks broken"

  • HTML/CSS errors in the template. Use the preview.
  • Images: must be reachable URLs / embedded data.

"Which template is used in the contract?"

  • A template can be selected on the contract itself — otherwise the default template is used.

Technical URLs (quick reference)

Admin (/settings/admin/templating):

  • GET /settings/admin/templating — list
  • GET /settings/admin/templating/new — new
  • POST /settings/admin/templating — create
  • GET /settings/admin/templating/{id}/edit — edit
  • POST /settings/admin/templating/{id} — save
  • POST /settings/admin/templating/{id}/delete — delete
  • POST /settings/admin/templating/{id}/default — mark as default
  • POST /settings/admin/templating/preview — preview

Notes

  • TEMPLATING is closely tied to VERTRAG (PDF generation).
  • Keep templates clean and tidy — "one default template plus a few variants" is usually better than ten almost-identical files.