Knowledge Base
PressPrimer Certificate

Merge Fields in Text

Merge fields can sit inside a text element, mixed in with fixed words. This is a useful way to combine labels and dynamic data together into a single unit to more easily manage layouts. Write “Expires: ” and insert the expiry date field, and the whole line centers, aligns, and wraps as one piece. This article covers how to put fields into text, how to see what they will print, and when a standalone merge field element is still the better choice.

Inserting a Merge Field into Text

  1. Select a text element on the canvas, or add one from the palette.
  2. In the properties panel, place your cursor in the content box at the spot where the field belongs.
  3. Click Insert merge field and choose the field. Its token drops in at the cursor, and focus returns to the content box so you can keep typing.
Merge field in text

The picker lists the same fields as the Merge Field element, with a sample value for each, and it only shows fields the template’s trigger can supply. You can also type a token directly, like {{recipient.display_name}}. See Merge Fields for the full list of fields and their tokens.

Samples and Tokens

The Merge field display toggle in the designer toolbar controls how the canvas shows fields, in text elements and merge field elements alike:

  • Samples shows an example value in place of each field, so you can judge the real length of a line and how it wraps.
  • Tokens shows the raw {{group.field}} codes, so you can see exactly what is in the text and edit the words around it.

Neither mode changes what is saved. The toggle only affects what you see on the canvas. The Preview button always renders a sample PDF with example values filled in.

What Prints on the Certificate

Fields inside text resolve at issue time from the same data as merge field elements, so a value is identical whichever way you place it. The resolved values are stored with the certificate and never change afterward. A few rules are worth knowing:

  • A field with no value prints nothing. If a template’s validity is set to Never, the expiry date is blank, so “Expires: {{certificate.expiry_date}}” prints as just “Expires:”. Add that line only to templates that set a validity period.
  • A mistyped or unknown field also prints nothing. You will never see stray curly braces on an issued certificate, so if a line comes out shorter than expected, switch to the Tokens view and check the spelling of the token.
  • Source fields (course title, quiz score, and so on) come from the activity that fired the trigger. With an “Any” trigger, each certificate names the specific course or quiz the learner completed. On a manually issued certificate there is no source activity, so source fields are blank.

Text Elements or Merge Field Elements?

Use a text element with merge fields whenever a label and a value belong on the same line: “Completed on {{source.completion_date}}”, “Score: {{source.score}}”, or “Presented by {{site.name}}”. The line stays together through centering and wrapping, which two separate elements cannot do.

The Merge Field element is still the right choice in two cases:

  • The value stands on its own. Everything in a text element shares one font, size, and color. To style a value differently from its label (a large script name above a small “has completed” line, for example), keep them as separate elements. The starter templates use a merge field element for the recipient name for exactly this reason.
  • You want the credential ID to be clickable. On issued PDFs, a Credential ID merge field element is a link to the certificate’s verification page. The same token inside a text element prints the ID but is not clickable. See Credential IDs and Verification.

The same double-brace tokens also work in the certificate email subject and body, so the email can name the exact course or quiz that was completed. See Email Notifications.

Get Tips, news & Discounts to your inbox

Get your own demo site

Get Tips, news & Discounts to your inbox