Adding tokens to content

Add tokens to any content to make the content more dynamic. When content containing a token is displayed, the token is replaced by text that can be calculated at that moment, based on information that includes the current date, site details, and more. For example, you could insert the token [site:mail] in a blog post and when the blog post is displayed, the administrative email address for the website appears in the blog post.

Enabling tokens

When you enter data to a field with a formatting toolbar, you can select from any of the available text formats for its content. The text format you choose specifies how to display your content, including whether or not to replace any tokens you enter with their associated value.

To configure a text format to enable tokens:

  1. Go to Configuration > Text formats, and click the configure link for the text format that you want to modify (for example, Full HTML).
  2. In the Enabled filters section, select the Replace tokens check box.
  3. Click Save configuration.

You can now use tokens with fields that use a configured text format.

Adding tokens to fields

After you modify one or more text formats to replace the tokens you enter with their values, you can use tokens with your content.

Note: You can only use tokens in fields where the content type is configured to filter text. Not all fields can filter entered text. For more information about content type fields, see Custom and customized content types.

To add a token to a field:

  1. In the admin menu, click Content, and then click the Add content link.
  2. In the Body field, select a content type, such as Basic page.
  3. Select a text format that you've configured to replace tokens. In the example above, it was Full HTML.

    Text format menu

  4. Add tokens to the field and they will be replaced with the token values.

    For a list of available tokens, click the More information about text formats link.

    Available tokens link

Adding tokens to notification emails

For information about using tokens with notification emails to your users, see the Using tokens with notification emails section of Webforms.

Feedback