Skip to content

Templates: Google Docs with variables to fill in

Describes Document Creator 0.10.0.

A template is a Google Doc with placeholders in it. When someone creates a document from it, Document Creator copies the template and fills each placeholder with the value they give. The Templates page is where you make templates and keep them organized.

Where to find it

In the admin sidebar, open Document Creator, then Templates, or go to /admin/document-creator/templates. You need the Document Creator permission, and a Google account must be connected on the module’s settings page.

Making a template

New Template creates an empty Google Doc called “Untitled Template” in the templates folder and opens it in Google Docs in a new tab. Rename it and write it there. Any Google Doc you put into the templates folder in Drive, or a subfolder of it, also shows up here after the next refresh.

Open Folder opens the templates folder in Google Drive.

Writing variables

Type placeholders in double curly braces anywhere in the document:

  • {{ client_name }}: a text variable. The person creating a document types a value for it. A name may contain letters, digits and underscores; spaces inside the braces don’t matter.
  • {{ image: logo }}: one picture, chosen from the media library.
  • {{ images: photos }}: several pictures, chosen from the media library.

The form shows each variable with its name in plain words: client_name becomes “Client Name”. A text variable whose name contains “description” or “notes” gets a multi-line box. Variables are read from the template each time someone picks it, so a variable you add in Google Docs shows up the next time the template is used.

Image variables have layout settings that are set in the create dialog the first time someone uses the template, and kept for the template from then on: width, whether drawn annotations are included and, for several images, the separator, the number of columns, Fit width or Fit page, and a maximum count. See the Documents guide.

The list

Templates are shown as cards or as a list, with the same toolbar as the Documents page: Search by name…, All Categories, All Types, All Statuses, sorting in the list view, and twenty per page. When the Languages module has languages enabled, there is also All Languages.

On each template you see:

  • a language badge, such as EN, or a dashed — when the template has no language (only when languages are enabled);
  • its category: the one name, or the first name with “+1”, “+2” and so on for the rest, or — if it has none. Hover over it to see every category;
  • Edit, which opens the template’s settings (below).

The Actions menu holds Edit (open it in Google Docs), Export PDF, Refresh thumbnail and Delete. Delete moves the template to the deleted folder in Drive without asking. Trash and Restore work as on the Documents page.

Language, categories and groups

The Edit button next to the category opens Edit template:

  • Language: the language the template is written in, or No language. Shown only when the Languages module has languages enabled.
  • Categories & groups: tick each category the template belongs to. A template can be in several. For each ticked category, a drop-down chooses a group in it, or No group. If no categories exist yet, it says No categories yet.

Nothing changes until you click Save. Cancel closes the dialog and drops the changes. If saving fails, the dialog stays open with your changes so you can try again.

Groups are what the Categories page calls types.

What it doesn’t do

  • Templates are written in Google Docs. There is no editor for them in PhoenixKit.
  • Variables have no fixed list or required flag. Whatever placeholders the document holds are the variables.
  • Changing a template doesn’t update documents already made from it.
  • The category filter on this page goes by one category per template: the first of its categories in the Categories page order. A template in several categories shows up only under that one.