Drupal Taxonomy vs Content Type Field

Drupal ships with an incredibly powerful and flexible categorisation system, called Taxonomy. However, many developers and site builders get confused when trying to decide if something should be a taxonomy term or a field in its own right.

There is not a hard and fast rule and people will give different advice. But as a general guidance, the following two questions should help in the decision making process:

1) Will the term/item/field be present on more then one content type?
2) If the term/item/field is removed, does the content type still make sense?

1) Will the term/item/field be present on more then one content type?

If the answer to the first question is yes, then in most cases I would recommend using Taxonomy.
An example might be a food website with one content type being recipes and another being cooking tips. If both content types require a field called cuisine, which indicates the country or culture that the food is from (eg Italian cuisine), then cuisine should be a taxonomy. If a user is looking at the term page for Italian cuisine, then that user will see both recipes and cooking tips that have been tagged with "Italian cuisine". Similarly you could create a view page with both content types as filters to show related cuisine information.

2) If the term/item/field is removed, does the content type still make sense?

If the answer to the second question is yes, then again I would recommend using Taxonomy. But it is not as clear cut as the first question. If the field can be removed and the content type still makes sense, then there is a good chance that in the future, another content type could be added with the same term/item/field. At that point in time you will ask yourself the first question, so by using taxonomy from the start, you will save yourself some time and effort in moving field data to a taxonomy.

This is a pretty straight forward and simplified way of looking at the question of taxonomy vs content type field, but hopefully it will be of some help.

Post new comment

The content of this field is kept private and will not be shown publicly.

Learn how to write custom Drupal modules

Does Drupal module development make your head explode and drive you crazy?

Why not learn from someone who has paved the way instead?

Sign up to Master Drupal 7 Module Development.

Hello!!

I am Blair Wadman and this is where I write about Drupal, PHP, CSS etc

Stuff

Syndicate

Syndicate content

© Blair Wadman
2005 - 2011