The Taxonomy Token module allows the user to set vocabularies for which there will be created specific tokens. It's main use is together with the Pathauto module.

Drupal 7 support

As far as I can tell, this module isn't necessary in Drupal 7 at all.

The core Taxonomy and Token core modules already offer similar features.

It should be noted that Taxonomy in Drupal 7 works rather differently than it did up to Drupal 6. This is not the place to explain in detail the differences but in resume in Drupal 7 Taxonomies are related to nodes through fields of the type Term reference.

To get Taxonomy term info for some node you should use something like [node:field_my_vocabulary]in Drupal 7 where you would use [node:vocab:TID:term] in Drupal 6 with the Taxonomy Token module. This example considers you named your term reference field My Vocabulary.

When migrating from Drupal 6 to Drupal 7 you will have to manually change the tokens from the old format to the new one.

For more complex scenarios you can try the Compound Token module. I've not tried it but it promises major flexibility that should enable even the wildest requirements.

Drupal 6

Features

It can create two types of per vocabulary tokens: single term and full term path.

As the creation of specific tokens for each vocabulary might have some noticeable performance impact it's advised to enable specific token creation only for the vocabularies that will actually be used. The performance impact will probably be more intense with the creation of full term path tokens.

Dependencies

  • core Taxonomy module
  • Token module

Usage documentation

Usage documentation is maintained as Advanced Help pages.

Credits

Taxonomy Token is maintained by rsevero

Development is sponsored by Fábrica de Ideias.

The idea for this module came from code available at #185446-22: Provide tokens for each vocabulary from jenlampton.

Roadmap

There are no new features planned. The roadmap for now is just a, hopefully, straight line to a stable release with at least a one-week BETA and another one week RC.

Other

You can see the issue queue.

Comparison with Category Tokens module

The Taxonomy Token module is similar to the Category Tokens module. Here is an attempt to outline it's differences.

Vocabulary identification method

Taxonomy Token uses the vocabulary id (number) to identify the vocabulary in the token name. For example [node:vocab:1:term] is the top term name in vocabulary with id 1. This method guarantees that token names remain constant even in case some vocabulary name is edited.
Category Tokens used a simplified version of the vocabulary name. For example [first-term-name-in-office-position-or-title would result in the same info as above if the vocabulary with id 1 is named "Office, position or title". This method provides more readable token names.

Available tokens

Taxonomy Token offer a few tokens not available in Category Tokens, namely the tokens that provide all parents of each token:

[node:vocab:TID:termpath]
As [node:vocab:TID:term] above but including its supercategories separated by /.
[node:vocab:TID:termpath:url]
As [node:vocab:TID:term:url] above but including its supercategories separated by /.
[node:vocab:TID:termpath-raw]
As [node:vocab:TID:term-raw] above but including its supercategories separated by /. WARNING - raw user input.
Configuration options X performance impact

Taxonomy Tokens allows the user to set one of the following token type options per taxonomy:

  1. no tokens generated;
  2. only single term tokens generated;
  3. single and complete (full path) token generated.

With these options the performance impact of the module can be reduced to the minimum necessary to achieve the desired results by enabling token generation only for the pertinent taxonomies.
Category Tokens has no similar configuration options.

Project Information

Downloads