What is the difference between Category Token and Taxonomy Token? (http://drupal.org/project/taxonomy_token)

Comments

dman’s picture

Difference #1 is that I can't grab it with drush to evaluate it quickly.

$ drush dl category_tokens
There is no *recommended* release for project category_tokens on Drupal 6.x. Ask the maintainer to review                     [ok]
http://drupal.org/node/197584 and create/recommend a release in order to be compatible with drush and the drupal.org security
broadcast system. 

Difference #2 is that taxonomy_token is a better name :-)

taxonomy_token offers a handy configuration UI at admin/settings/taxonomy_token (select which vocabs to generate tokens for), category_tokens doesn't

taxonomy_token has some documentation, category_tokens doesn't

taxonomy_token offers the following sort of tokens for each chosen vocab:

[node:vocab:1:term]	Top term name in vocabulary Office, position, or title.
[node:vocab:1:term:url]	Top term name in vocabulary Office, position, or title modified to be used in URLs and paths (Pathauto for example).
[node:vocab:1:term-raw]	Unfiltered name of top term in vocabulary Office, position, or title. WARNING - raw user input.
[node:vocab:1:term-id]	ID of top term in vocabulary Office, position, or title.
[node:vocab:1:termalias]	URL alias for the term.

category tokens (although it mis-labels itself taxonomy tokens in the UI) provides this:

[first-term-id-in-office-position-or-title]	The id of the first term within the Office, position, or title vocabulary
[first-term-name-in-office-position-or-title]	The name of the first term within the Office, position, or title vocabulary
[first-term-name-in-office-position-or-title-raw]	The name of the first term within the Office, position, or title vocabulary 
[first-term-name-in-office-position-or-title-path]	The name path of first term within the Office, position, or title vocabulary
[first-term-name-in-office-position-or-title-path-raw]	The name path of first term within the Office, position, or title vocabulary 
[last-term-id-in-office-position-or-title]	The id of the last term within the Office, position, or title vocabulary
[last-term-name-in-office-position-or-title]	The name of the last term within the Office, position, or title vocabulary
[last-term-name-in-office-position-or-title-raw]	The name of the last term within the Office, position, or title vocabulary
[last-term-name-in-office-position-or-title-path]	The name path of last term within the Office, position, or title vocabulary
[last-term-name-in-office-position-or-title-path-raw]	The name path of last term within the Office, position, or title vocabulary 

Generally, I prefer seeing readable strings in my tokens, but hm.

If you need first and last terms, then category_tokens would be helpful.
I'm a bit more comfortable with taxonomy_token - because I only need it for single-select vocabs.
There may be room to merge the concepts, but now they are doing slightly different jobs. Clearly they should at least be cross-referencing each other on the project page.

OneTwoTait’s picture

The best documentation for these modules that I've seen so far is this post. :)

It seems both Taxonomy Token and Category Token are only useful on nodes! I tried using them to generate a page title on a taxonomy term page and it didn't work.

Another downside for Category Token is that it uses the taxonomy names rather than numbers, which means some taxonomies won't be usable. For example, I have a taxonomy called "City, Province" and that won't work with Category Token.

dman’s picture

It has actually cleaned up the vocab names. in my example above the vocab "Office, position, or title " became "office-position-or-title"

rsevero’s picture

To taite11:

If you are interested in "taxonomy" context tokens from Taxonomy Token module, please take a look (and provide more info) at #953980: Should Taxonomy Token provide "taxonomy" type tokens besides "node" ones?.