Order matters... at least with pathauto and taxonomy!

in drupal, taxonomy, pathauto

In most cases, when building a Drupal site I prefer to have a single content type, with nodes distributed in sections via a vocabulary. It then makes sense to use the term in the node aliased path -- unless you have multiple vocabularies.

The problem arises from the way pathauto handles the [termpath-raw] token. Up to this day, there is no (straightforward!) way to select which vocabulary to use in order to generate the aliased path (in v6.x at least).

There is however an undocumented (or scarsely documented?) way -- pathauto (or rather, token) uses the first vocabulary (by weight) to generate these tokens. Thus, all you need to do is navigate on to admin/build/path/pathauto and simply drag the vocabulary you want to the top. Pathauto will then use the top vocabulary for the [termpath-raw] token.

Be sure that any vocabulary-wide change ( adding, editing etc ) doesn't change their order (and yes I know it shouldn't...)

Image was created by blamcast.net