A token is a reusable piece of content that you can place anywhere on your site. When you update the token, every page that uses it updates automatically. This saves time and keeps content consistent across your site.
For example, if your phone number appears on twenty different pages, you can store it as a token. Update the token once and all twenty pages show the new number.
What you can do here
From the Site > Tokens page, you can:
- Add a new token.
- Edit the content of an existing token.
- Search, filter, and sort your tokens.
About tokens
Every token has three main parts:
- Handle. The short name you use to reference the token elsewhere on your site. For example, a token with the handle phonenumber is placed on a page as {{ tokens.phonenumber }}.
- Token Type. The format of the token's content. The type controls how the content is edited and how it displays on your site.
- Content. The actual content the token holds. This is what gets shown on every page that uses the token.
About handles
Handles must follow these rules:
- Use only letters, numbers, underscores (_), and dashes (-).
- No spaces or other special characters.
- Maximum 256 characters.
- Must be unique across your site.
Keep handles short, lowercase, and descriptive. phonenumber or main-cta are better than NewPhoneNumberFinalUpdated2024.
About token types
You'll choose one of these types when creating a token. Once a token is saved, the type stays the same.
- Text. The simplest type. Use this for plain words or short pieces of text like a phone number, an address line, or a short headline. No formatting.
- Rich Text. Like a mini word processor. Use this for content that needs basic formatting, like bold, italics, links, headings, and lists. The editor looks similar to the editor inside a blog post.
- HTML. For more advanced content. Use this only if you're comfortable with HTML. Common uses include embedding code from another service, like a custom form or third-party widget.
You may see other types in the dropdown (such as Markdown, JSON, or Camilyo). These are for advanced or system uses. If you think you need one of them, reach out to support for help.
Add a new token
Step 1: Open the Tokens page
- From the left sidebar, click Site.
- Click the Tokens tab.
Step 2: Start a new token
Click the Add New Token button in the top right corner of the page.
Step 3: Fill in the Handle
Type a handle in the Handle field at the top. As you type, you'll see a preview of how the token is referenced elsewhere on your site (for example, {{ tokens.your-handle }}).
Step 4: Pick a Token Type
On the right side of the page, choose a Token Type from the dropdown. For most tokens, Text or Rich Text is the right choice. Use HTML only if you're comfortable with code.
Step 5: Add the content
Fill in the Content area in the middle of the page. The editor you see depends on the Token Type you picked:
- For Text, you'll see a simple text box.
- For Rich Text, you'll see a rich text editor with formatting buttons (bold, italics, links, and so on).
- For HTML, you'll see a code editor.
Step 6: Save
Click Save & Publish in the top right corner.
Next to the Save & Publish button is a dropdown that controls what happens after you save:
- Continue Editing (default). Stays on the token so you can keep editing.
- Go To Listing. Returns you to the tokens list.
- Create Another. Clears the form so you can create another token right away.
Use a token on your site
To use a token, reference it by its handle, wrapped in double curly braces and prefixed with tokens.
For example, a token with the handle phonenumber is used as:
{{ tokens.phonenumber }}You can place this anywhere on your site that accepts text or code, including blog and post content, custom code areas, and other tokens. Wherever you place it, the token's content appears in its place.
Edit an existing token
- From the left sidebar, click Site, then click the Tokens tab.
- Find the token you want to update. Use the search bar at the top of the list if you have a lot of tokens.
- Click the pencil (edit) icon next to the token, or click the three-dot menu and choose Edit.
- Update the Content as needed. (The Token Type can't be changed once a token is saved.)
- Click Save & Publish.
Note: Some tokens are marked as restricted. For these, you can still update the Content, but you can't change the Handle. Reach out to support if you need to make changes to a restricted token's handle.
Search, filter, and sort
If you have a lot of tokens, you can narrow the list:
- Search. Use the search bar at the top of the list to find a token by handle, content, or other fields.
- Filter. Click the filter button to filter by date created, date updated, token type, or who created the token.
- Sort. Click any column header to sort the list by that column. Click again to reverse the sort.
What if I see an error?
- "Handle is required." Type a handle before saving.
- "Handle can only contain letters, numbers, underscores ( _ ) , and dashes (-)." Remove any spaces or special characters from the handle.
- "Handle cannot start or end with spaces." Remove any spaces from the beginning or end of the handle.
- "Handle must be under 256 characters." Shorten the handle.
- "Content is required." Add content before saving.