Why even use Taxonomy at all?

Prodigy - September 13, 2007 - 06:11
Project:CCK Taxonomy Fields
Version:5.x-1.2
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

Can't CCK do the exact same thing that taxonomy does??

Traditional:
Vocab: Colors
Term: green
Term: yellow
Term: blue

CCK Text Field Select List : Color
allowed values: green
allowed values: yellow
allowed values: blue

#1

sloebs - September 24, 2007 - 18:02

Good question. There are some Views complications when you use CCK Taxonomy Fields as filters that you don't have when you use your textfield solution. However, there are some lost features and some caveats.

For example, it is a good practice to not duplicate functionality. One loses efficiency and risks introducing additional errors. Also, the many powerful features of Drupal's taxonomy system are well known and need not be repeated here.

Now to the caveat. If you are going to use the 'allowed values' as you showed in your example, then you will have additional and unnecessary problems. Be sure to use different keys and labels as values. Think of the key ID as you would the taxonomy ID. Whereas the taxonomy module creates the ID's automatically and behind the 'scene' of the taxonomy form, you will need to explicitly create those key ID's with your method.

An example of a typical problem if you only use keys as values -- as in your example -- is that you may not change anything about those values without having to go back to each and every node that you (or your users) chose to use that value and fix it. Or you will have to go into the database table and fix it there.

Avoid that costly mistake by using the 'key|label' format. So going back your example of:

CCK Text Field Select List : Color
allowed values: green
allowed values: yellow
allowed values: blue

You could instead use:

CCK Text Field Select List : Color
allowed values: kid010|green
allowed values: kid020|yellow
allowed values: kid030|blue

Then if you later want to change the allowed values list to capitalized labels and add another color of red between green and yellow, you would change to this:

CCK Text Field Select List : Color
allowed values: kid010|Green
allowed values: kid015|Red
allowed values: kid020|Yellow
allowed values: kid030|Blue

#2

robertDouglass - September 28, 2007 - 21:18

CCK doesn't have any hierarchical lists. Taxonomy does.

#3

Prodigy - October 12, 2007 - 00:39
Status:active» closed

#4

nessumsara - August 5, 2008 - 21:33
Status:closed» postponed (maintainer needs more info)

I already have a site setup where the select lists use the same value for key and label. I have a couple questions.

1. If I change the order of the values in the list but don't change the the value itself will I need to reassign values to nodes or am I safe?

2. Same question if I insert a new value (no change to existing values except for the change in order caused by the insertion?

3. Is there a way for me to retrofit the select list without loosing values already assigned to nodes?

 
 

Drupal is a registered trademark of Dries Buytaert.