What is the power of CCK? A practical example
CCK is comprised of 2 things:
- fields: These refer to the data that's being stored. For example, Text or Number.
- widgets: These refer to how the input widget an end user uses to enter the data looks. For example, Text field or Check boxes.
CCK's data model consists of 3 base tables:
- node_type_content: A table containing the CCK node type defninitions: name, label, description, help, and the label given to the node's Title field.
- node_field: A table containing the various field definitions: field name, type, and various settings.
- node_field_instance: An individual instance of a field applied to a content type, along with its widget settings. For example, field_description in the content_blog type and field_description in the content_product type.
In addition, each new content type creates its own table, called node_content_X, where X is the name of the content type. This table contains a node ID (nid) and revision ID (vid) field, along with the values of any extra fields, if the field is specific to that content type.
If, however, a field is shared among more than one content type, a table called node_data_field_X, where X is the name of the field, is also created to track the field's settings between node types.
There are a number of modules that integrate with CCK. Some are field modules that allow you to create specific kinds of fields. Others are helper modules that add functionality to CCK. Some modules are considered 'core' components and are packaged with the content module and maintained by the CCK maintainers.
Changes in Drupal 5
In Drupal 5 node_content_X was named to content_type_X and node_data_field_X into content_field_X