An example module showing how to define and use tokens.

Tokens are small bits of text that can be placed into larger documents via simple placeholders, like %site-name or [user].

File

modules/examples/token_example/token_example.module

Functions

Namesort ascending Description
_token_example_get_user Builds a list of available user accounts.
_token_example_get_taxonomy_term Builds a list of available taxonomy terms.
_token_example_get_node Builds a list of available content.
_token_example_get_file Builds a list of available files.
_token_example_get_comment Builds a list of available comments.
token_example_menu Implements hook_menu().
token_example_example_form_submit Submit callback; store the submitted values into storage.
token_example_example_form Form builder; display lists of supported token entities and text to tokenize.
token_example_entity_info_alter Implements hook_entity_info_alter().