Designing a Basic Template from Scratch
Last updated
Last updated
To design a template from scratch, start by clicking the New Template button on the top right and selecting the blank template. The next screen is the template designer.
Unlike other document generation applications that use a word-processor style editor, Documint uses a block-style drag-and-drop editor. This gives you the most control over your template design and layout.
The template designer is composed of three main panes:
On the left is the Add pane, which has Content and Layout elements you can add to the document
Examples of content elements include forms of information like text and images
Examples of layout elements include ways of organizing the template space, such as sections, rows, and columns
Selecting an element will enable you to configure its properties, this pane will also appear on the left
At the center of the screen is the canvas, where template elements are placed according to your design
On the right hand side is the Data pane, where you can link Document to other services through integrations, as well as create and manage data placeholders called variables.
To get an idea of how elements work at a basic level, we’ll build a super-minimal name and date template. More advanced layout instructions are located in the rest of the [Design/Layout] section.
You’ll notice the template name ‘Blank’ on the top left of the screen. Click the text to edit it and type in a new name to describe this template such as ‘Account Note.’
If starting from a blank template, the first element to insert, which serves as the foundation for any other layout or content element is the section element in the Layout panel. Sections are the only element that can be placed directly on the template body. Insert the first section by dragging it from the Layout panel to the template.
Let’s begin with just a name and date on the top of the page. Drag two text elements into the two columns which appear by default with the first section that was created in the preceding step.
The left one will be the account name. Double-click the text element and type a label “Account Name: ” in the text field. Do the same for the right one, but for the date instead, typing “Date: ” in the text field.
To populate these fields with different account names and different dates, we’ll use variables. Variables are placeholders that can change the value for each document depending on the data that is given as input. For example, if you are merging multiple documents from a list of accounts in a table, the ‘name’ variable can serve as the placeholder for different account names in each generated document.
If you know the right formatting, it’s easy to create variables by just typing them. For now, let’s use the ‘New Variable button’ on the right-hand Data pane. In the window that appears, type ‘account_name’ as the variable and copy the generated variable name.
* In general, variable names should be all lower-case, have no special symbols, and spaces should be replaced with underscores.
Paste the {{account_name}} variable after the Account Name label you typed, such that the left column reads: “Account Name: {{account_name}}”. Then, do the same exact procedure with a date variable called “date,” which should generate the variable name: “{{note_date}}”. Or, you could just type in “{{note_date}}” and save a step or two. You can confirm the created variables by seeing them on the right-hand Data pane, under the Template Variables section.
To build out the rest of the document template, you can either add more columns/rows to the existing section (you can drag the edges of a section to expand it), or you can add more sections. Let’s add a second section that contains a single column for notes. To do this, drag a section element under the existing one and delete one of the two default columns.
Like before, drag a text element into that column to create a text box that extends across the entire page. Then, double-click the text element and type “Notes: {{note}}”. As you can see, we created a third variable called {{note}}.
Let’s format this text to be a bit different from the rest. Click on the text element in the left-hand Properties pane, and navigate to the Text section to modify the properties of the text field, such as font and alignment. You can experiment with different fonts. Here, we selected the Montserrat font, with a bold weight, and font size of 20px. Then we set the alignment to be center-aligned.
Finally, let’s test this basic template out by using the preview mode. Preview mode allows you to type in your own input values for the variables in the document and see how they would look in a final merged document. Click the Preview button above the template designer.
Then, enter some test values into the three variable fields and click ‘Save & refresh’ to see how the document turns out.
You can tell the template works properly because the values entered on the left appear on the right, exactly where and how we would expect them to.