Token Module: How I Learned To Use the Token API and Stop Re-Implementing Dynamic String Replacement


The Token module provides developers with a way to get data about objects in their sites and use that information to create dynamic strings. You probably are familiar with this type of system from configuring Pathauto or the User welcome email. Strings like !username or [title] get dynamically interpretted to the proper values. The token module provides an API which allows module developers to use this kind of dynamic string replacement in their modules without having to rewrite the string replacement code. It also allows module developers to "expose" tokens from their module for use in other modules.



This session will cover:

  1. Basic uses of the Token module from the end user's perspective
  2. Implementing the Token API in your module to allow other modules to get structure data about your module
  3. Using the Token API to dynamically replace strings in your emails and site messages (drupal_set_message)
  4. Brainstorming the future of Token module - how can this module be improved to be easier to use and more valuable?


Greg Knaddison (greggles) - co-maintainer of Token Module - is a Drupal Developer for pingVision. When not developing Token Module or presenting about it, he likes to travel with his wife.
Jeff Eaton
- who is the original author and architect of token module - will be listening in and leading the "what is the future" section of the session.

Average: 4.4 (25 votes)