Content Construction Kit (CCK)
CCK is one of the handful of must have modules* if you want an easy way of customizing content types. It allows you to add custom fields to any node type. There are a large array of field types provided by stock CCK and via many add on field types. Esentually the CCK enables non programmer admins to replicate the work that traditionally was done with custom node modules.
The asterisk on must have modules is because some programming purest shun admin crutches such as the CCK as performance drains, difficult to manage and lacking flexibility (among other things).
The CCK is a very powerful module and is one of a handful of central modules for many Drupal sites. It enables users to configure content types via the Drupal adminstration rather than having to do custom programming. It can be a time saving convince if you have programmers and a necessity of you are not.
It allows you to create a wide variety of fields, even very advanced once such as imagefield_crop will save you a lot of programming time. Examples of some fields the CCK can produce:
- text fields
- text area
- selects & muti selects
- check boxes & radios
- user reference selects and autolookups
- node reference selects and autolookups
- date with js pop up calendar
- image upload fields & image croping upload
- audio & video upload
- embed fields
CCK fields come with some nice features such as
- AJAX autolookup to replace long select boxes
- Multi values - enables users to enter more than one entry. For example uploading multiple images via the same image upload field or select
Pros
- save time by configuring complex content types vs. programming modules for them
- less bugs (in theory) - to program a module, muliple hooks (form, validate, insert, update, delete, load, access) have to all support the data correctly. CCK fields handle this automatically
- easily produces complex (JS/AJAX driven), well tested fields that have been tested on multiple sites
- easy to make changes to (this is both a pro and con)
- does not require programmers time to modify content type
- automatic views support vs. in programmed modules, a custom views hook must be added to enable module fields to be used in views
Cons
- Performance - The CCK is less efficient (possibly significantly so), particularly when loading nodes or fields that are shared across content types or have multiple values enabled, then well written custom programmed modules.
- Flexibility limits - The customizing you can do is very robust but does have its limits vs. custom programming.
- Additional management difficulty - There are several management issues that the CCK creates:
1. Anyone with administrator access can edit the sites node types and delete data. This can be fixed by maintaining adequately restrictive roles and access.
2. CCK node configuration is store in the database vs stored in files in custom programming. Worse yet the information is stored in multiple tables. Configuration stored in files is generally easier then in databases, particularly a database that stores both configuration and user data.
3. Changing field names. The CCK will sometimes move a field around (when a field is shared with a second content type)
Tips
Resources
Content Construction Kit (Drupal Module)
Used to add customized fields to nodes without requiring module programming.
