List of tokens

Last modified: April 10, 2009 - 21:46

Comment tokens

[comment-cid] Comment ID
[comment-nid] Comment's node ID
[comment-title] Comment title
[comment-title-raw] Comment title. WARNING - raw user input
[comment-body] Comment body
[comment-body-raw] Comment body. WARNING - raw user input
[comment-author-uid] Comment author's user id
[comment-author-name] Comment author's user name
[comment-author-name-raw] Comment author's user name. WARNING - raw user input
[comment-yyyy] Comment creation year (four digit)
[comment-yy] Comment creation year (two digit)
[comment-month] Comment creation month (full word)
[comment-mon] Comment creation month (abbreviated)
[comment-mm] Comment creation month (two digit, zero padded)
[comment-m] Comment creation month (one or two digit)
[comment-ww] Comment creation week (two digit)
[comment-date] Comment creation date (day of month)
[comment-day] Comment creation day (full word)
[comment-ddd] Comment creation day (abbreviation)
[comment-dd] Comment creation day (two digit, zero-padded)
[comment-d] Comment creation day (one or two digit)

Node tokens

[nid] Node ID
[type] Node type
[type-name] Node type (user-friendly version)
[language] Node language
[title] Node title
[title-raw] Unfiltered node title. WARNING - raw user input.
[author-uid] Node author's user id
[author-name] Node author's user name
[author-name-raw] Node author's user name. WARNING - raw user input.
[author-mail] Node author's e-mail.
[author-mail-raw] Node author's e-mail. WARNING - raw user input.
[term] Name of top taxonomy term
[term-raw] Unfiltered name of top taxonomy term. WARNING - raw user input.
[term-id] ID of top taxonomy term
[vocab] Name of top term's vocabulary
[vocab-raw] Unfiltered name of top term's vocabulary. WARNING - raw user input.
[vocab-id] ID of top term's vocabulary
[yyyy] Node creation year (four digit)
[yy] Node creation year (two digit)
[month] Node creation month (full word)
[mon] Node creation month (abbreviated)
[mm] Node creation month (two digit, zero padded)
[m] Node creation month (one or two digit)
[ww] Node creation week (two digit)
[date] Node creation date (day of month)
[day] Node creation day (full word)
[ddd] Node creation day (abbreviation)
[dd] Node creation day (two digit, zero-padded)
[d] Node creation day (one or two digit)
[mod-????] All tokens for node creation dates can also be used with with the "mod-" prefix; doing so will use the modification date rather than the creation date.
[menu] The name of the menu the node belongs to.
[menu-raw] The name of the menu the node belongs to. WARNING - raw user input.
[menupath] The menu path (as reflected in the breadcrumb), not including Home or [menu]. Separated by /.
[menupath-raw] The unfiltered menu path (as reflected in the breadcrumb), not including Home or [menu]. Separated by /. WARNING - raw user input.
[menu-link-title] The text used in the menu as link text for this item.
[menu-link-title-raw] The unfiltered text used in the menu as link text for this item. WARNING - raw user input.
[termpath] As [term], but including its supercategories separated by /.
[termpath-raw] As [term-raw], but including its supercategories separated by /. WARNING - raw user input.
[termalias] URL alias for the term.

Taxonomy tokens

[vid] The id number of the category's parent vocabulary.
[vocab] The vocabulary that the page's first category belongs to.
[cat] The name of the category.
[tid] The id number of the category.
[vocab-raw] The unfiltered vocabulary that the page's first category belongs to. WARNING - raw user input.
[cat-raw] The unfiltered name of the category. WARNING - raw user input.
[catpath] As [cat], but including its supercategories separated by /.
[catpath-raw] As [cat-raw], but including its supercategories separated by /. WARNING - raw user input.
[catalias] URL alias for the term.

User tokens

[user] User's name
[user-raw] User's unfiltered name. WARNING - raw user input.
[uid] User's ID
[mail] User's email address
[reg-date] User's registration date
[reg-since] Days since the user registered
[log-date] User's last login date
[log-since] Days since the user's last login
[date-in-tz] The current date in the user's timezone
[account-url] The URL of the user's profile page.
[account-edit] The URL the user's account editing page.

CCK text tokens

[field_scenario-raw] Raw, unfiltered text
[field_scenario-formatted] Formatted and filtered text
[field_example-raw] Raw, unfiltered text
[field_example-formatted] Formatted and filtered text

Node reference tokens

[nid] Referenced node ID
[title] Referenced node title
[title-raw] Referenced node unfiltered title. WARNING - raw user input.
[link] Formatted html link to the referenced node.
[path] Relative path alias to the referenced node.
[url] Absolute path alias to the referenced node.

Text tokens

[raw] Raw, unfiltered text
[formatted] Formatted and filtered text

Date tokens

[value] The raw date value.
[view] The formatted date.
[timestamp] The raw date timestamp.
[yyyy] Date year (four digit)
[yy] Date year (two digit)
[month] Date month (full word)
[mon] Date month (abbreviated)
[mm] Date month (two digit, zero padded)
[m] Date month (one or two digit)
[ww] Date week (two digit)
[date] Date date (day of month)
[day] Date day (full word)
[ddd] Date day (abbreviation)
[dd] Date day (two digit, zero-padded)
[d] Date day (one or two digit)
[to-????] If the field has a to-date defined, the same tokens exist in the form: [to-????], where ???? is the normal token.

Global tokens

[user-name] The name of the currently logged in user.
[user-id] The user ID of the currently logged in user.
[user-mail] The email address of the currently logged in user.
[site-url] The url of the current Drupal website.
[site-name] The name of the current Drupal website.
[site-slogan] The slogan of the current Drupal website.
[site-mission] The mission of the current Drupal website.
[site-mail] The contact email address for the current Drupal website.
[site-date] The current date on the site's server.

caveat: This list of tokens was originally taken from a comment left the token.module documentation page. Some of the tokens may only be exposed after specific modules are installed. Some of the tokens may change over the life of this document. Feel free to edit as seen fit.

 
 

Drupal is a registered trademark of Dries Buytaert.