Skip to content

Use variable tokens in content

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

Before you begin

  • Create variable sets — you need at least one variable set with keys defined before inserting tokens.

Insert a variable token

  1. Open a topic in the editor.

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

  3. Type / and select Variable, or click the variable button in the toolbar.

  4. In the picker, select the variable key (e.g., product_name).

  5. A styled pill appears showing the key name.

The Editor slash commands /variable is the fastest way to insert tokens. Start typing the key name after the command to filter the picker — useful when you have many variables defined.

How tokens display

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

  • On the published site: Tokens are replaced with the value from the target's variable set (e.g., "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 doesn't 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 key is missing from the target's variable set, the raw key name (e.g., product_name) appears 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?