Greg Knaddison
Growing Venture Solutions
July 2008
DrupalCamp Colorado
What are Tokens?
Little bits of text that get replaced with other bits of text.
Have you used:
ecommerce like ec_mail Custom Breadcrumbs Organic Groups - og Automatic Nodetitles (aka auto_nodetitle) Pathauto Upload Path PressFlow Placement Ubercart Invite Tokenize Audio Workflow-ng CCK Taxonomy CCK Full Name CCK Taxonomy SSU (Super Select Ultra) Fieldset Menus Node Relativity Backup and Migrate User stats Simplefeed Page title Token Node Tokens (TNT) Temporary Invitation Activity Type-local nids FileField Actions Token Email for 5.x
Me too.
If you haven't...here's a quick demo.
Token for Developers:
// Consuming tokens
// [user-name] - The name of the currently logged in user.
$original = 'Hello [user-name]';
drupal_set_message(token_replace($original, $type = 'global', $object = NULL,
$leading = '[', $trailing = ']')
// Prints "Hello greggles"
Providing Your Own Tokens
hook_token_list()
hook_token_values()
Questions? Ideas For Improvement? Bugs?


