Skip to content

Use variable tokens in content

This feature requires the Team capability tier (the Team or Business ). During the beta, every project is on the free Solo tier, so this feature is locked by default: go to Settings ▸ Billing and request Team access to unlock it.

Variable tokens are placeholders that resolve to different values depending on which Create variable sets the Publication target settings uses.

Before you begin

Insert a variable token

  1. Open a topic in the editor.

  2. Place your cursor where you want the variable value to appear.

  3. Click the variable icon ("Insert variable") in the editor toolbar.

  4. In the Insert variable dialog, type in the Search variables... field to filter, then select the variable key (for example, product_name).

  5. A styled pill appears showing the key name.

If no variables exist yet, the dialog shows an Add variables in Configure link. See Create variable sets.

How tokens display

  • In the editor: Variable tokens appear as colored pills showing the key name (for example, product_name).

  • On the published site: Tokens are replaced with the value from the target's variable set (for example, "Acme Pro").

For a variable set like this:

{
  "product_name": "Acme Pro",
  "support_email": "help@acme.com",
  "api_base_url": "https://api.acme.com"
}

Every product_name token across your topics resolves to "Acme Pro" when publishing with this set.

Use tokens in running text

Variable tokens work inline. You can write:

Welcome to product_name. For support, email support_email.

This renders as "Welcome to Acme Pro. For support, email help@acme.com." on the published site, with the actual values coming from the selected variable set.

Variable tokens can appear anywhere in a topic: headings, paragraphs, list items, table cells, and callout blocks. They cannot appear in image alt text or link URLs. For dynamic URLs, use a variable for the full URL in the link text and destination.

Handling missing variables

If a variable token references a key that does not exist in the selected variable set, the token renders as the raw key name. The Content health and governance system flags this as an undefined variable.

To avoid this, ensure every variable set contains all the keys used across your topics.

If a variable has no value in the project's variable sets, the key name appears in square brackets (for example, [product_name]) as literal text in the published output. The system flags undefined variables. Review the content health dashboard before publishing to catch these.


See also

Was this page helpful?