The Token module for Drupal 4.7 and 5 exposes simple text substitution tokens like [title] and [user-name], for use in path generation, mass mailings, and many other situation where admins want to set up text replacement patterns without using PHP snippets. Other modules can expose their own domain-specific replacement tokens (like information about a purchase, or an organic group that a user is a member of) and use Token's centralized replace() function to replace token occurrences in any piece of text.

If you are curious how you might use tokens or who is using it, consider this list of modules that use token

If you want to help get Token into Core then there's the issue. Please don't just subscribe to the issue or you will lose karma points in the eyes of some of Drupal's most respected community members.

tarun_nagpal's picture

Need help in "how to give token value on form submission"..?

Hello There,
I am facing a simple but strange issue.

I have a node form and i want a token that have the node URL that is being submitted/created. I want to send a thank you message to the user along with the node link.

Read more
dewolfe001's picture

Using CiviCRM fields in MailChimp

I have a Drupal 7.21 / CiviCRM 4.2.2 install.
It uses CiviCRM, MailChimp and Profile2. I need to put the first name and last name from a CiviCRM contact into the MailChimp for the mailouts. What I planned on using to make the linkage is Custom Token. I didn't want to write a custom module to pull this off if Custom Token were available to do almost the same job.

Here is what I built:

if (module_exists('civicrm')) {
$user = user_load(arg(1));

require_once 'api/v2/UFGroup.php';

$userID = civicrm_uf_match_id_get( $user->uid );
Read more
PlayfulWolf's picture

Easiest way to get tokens of the curently viewed node?


Prehistory: I am struggling big time with built-in Drupal 7 node->comments system and decided to design my own using Entity/Reference modules.

One of the first and simple ideas I am trying is to put node add form in the node page directly with the help of Formblock module and pass the ID of that node into one of the fields (the one, where this formblock is located).

So, for this to work I need to get token of this viewed node, how?

I know, that EVA module uses similar principle, but I want to avoid using it for this task.

Read more
davemurphy's picture

[newbie] Simple token in textarea not being processed

hi folks,

firstly apologies for what is probably a dumb question. However, this has driven me to the point of madness.

Objective: in a custom content type, print the site name (or user name) using the token [site:name]

Setup: Drupal 7.10 + Token Insert 7.x-2.0 + Token Filter 7.x-1.1

I have created a basic new content type. In the Body field I insert [site:name]. When I create an instance of that content, what is printed to screen is literally [site:name] and not the name of the site.

Read more
protoplasm's picture

Dynamic menu for organic groups

I'd like to create a menu with a link that changes automatically when in various different organic groups (6.x website). I looked at menu_token but there are no tokens for a group/nid/gid in 6.x. Is there a way to create a customized token that will work? For example, node/add/blog?gids[]=[token of group ID number]. Thanks.

Read more
mjstone323's picture

Drupal 6: Send customized emails to multiple addresses from fields within multiple field groups

I have a multi-step form that is a job application.

On one step the applicant enters information for professional references, and on another, character references. They may add multiple references (field groups) on each page. The field groups for both types of reference include an email field, and a hidden "email sent" field.

At the end of the form, when the applicant submits the form, I wish to send customized emails to each of the references, and populate the "email sent" field with "yes".

Read more
pgautam's picture

Token for friendlist module messaging rule not working for making a link in meaasge.

I had faced a problem in making a link for a particular text on message body, It creates a placeholder for the link on that particular text.

Read more
Dave Reid's picture

New releases of Pathauto imminent - help us test!

This week we'd like to release a new version of Pathauto for both Drupal 6 and 7. There have been numerous fixes for long-standing bugs with alias generation and internationalization. Oh and a few new features too (mostly in the 6.x-2.x and 7.x-1.x versions). As there have been quite a few changes made, we'd like your help testing either the 6.x-1.x-dev, 6.x-2.x-dev, or 7.x-1.x-dev versions.

Make sure when testing you have the latest development version of Token module downloaded as well.

Below are some of the major changes and bug fixes:

Read more
joerns's picture

Use page URL as Token


I just want to use the URL of the current page as a Token with Views (for ?destination=...)
I've been searching for hours, tried different modules (like tokenSTARTER) but it didn't work.

Help! Why is it that difficult?
Thanks a lot.

P.S. Sorry if using the forum would have been better but I thought I'd better ask the guys who made it...

Read more
David Naian's picture

Tokens and Domain

Hi, I am intensively testing Domain.module and have noticed that in the Modules that Use Token Module the Domain Access module is not listed. It would be interesting to know if there are some issues about or any kind of feedback you may know about, that may be related to the 2 modules installed togheter. Feedback very much appreciate.

Read more
Subscribe with RSS Syndicate content