Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module allows you to create custom tokens for use in Drupal. It provides a flexible way to define replacement text for various scenarios, enhancing the functionality of other modules that use the token system. The latest versions offer improved security and configuration options for defining custom tokens.

It gives the user the ability to create custom tokens for specific replacements that can improve other modules relying on the Drupal 7 token API or, for Drupal 6, the Token module.

Versions 7.x-1.x and previous relied on PHP evaluation to build custom tokens.

The new 7.x-2.x relies on input filters. While still allowing for PHP tokens through the D7 core PHP filter module, administrators can permit only HTML or plain text custom tokens.

New features in version 7.x-2.0

  • Build tokens using input filters (#1336622)
  • Define custom token types (#1341106)

Versions 7.x-1.x and previous

They are designed for developers with, at least, a little PHP knowledge. Custom tokens will evaluate and execute PHP snippets in order to provide the replacements for the tokens you define.

Version 8.x-1.x

For security, PHP snippets are not supported.

Related modules

Dependencies

Token

Alternative modules

  • The Parameters module makes parameters available as tokens and are completely configuration-based (exportable / importable through configuration). Major difference that a parameter token always starts with [parameter:*] whereas this module allows specifying a token type on root level.

Sponsored by (versions 5.x and 6.x)

Infomagnet

Sponsored by (versions 8.x)

Drupal Geeks
DROWL.de

Activity

Total releases
3
First release
Feb 2025
Latest release
9 months ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Slowing

Release Timeline

Releases

Version Type Release date
8.x-1.0 Stable Sep 30, 2025
8.x-1.0-beta2 Pre-release Feb 25, 2025
8.x-1.0-beta1 Pre-release Feb 4, 2025