Content Type Madness (CTM): Symptoms, Treatment, and Prevention
[img_assist|nid=1045|title=|desc=|link=none|align=left|width=100|height=80]Content type madness is a common disease that effects drupal sites of all sizes. It is most frequently seen in drupal 5 and 6 sites, as result of content construction kit.
It is a serious, chronic disease that can result in long term damage to a site's agility, usability , and information architecture.
Common symptoms of content type madness include:
- More than 11 content type*
- Dubious distinctions between content types [e.g. press release, vs. annoucement, vs. news item, vs. alert]
- No use of drupal taxonomies
- Overuse of views
- Users of site reporting feelings of malaise, and depression after working with content on the site.
Frequent complications of content type madness include:
- Improperly set content defaults, ranging from internationalization, to comment settings, to publishing workflow, to user permissions.
- Presentation inconsistency due to the proliferation of node-[type].tpl.php files.
- Switch statements that exceed 200 lines in the hook_preprocess_node(&$vars) function in the template.php file.
Treatment of content type madness is usually difficult, time consuming, and often requires the services of drupal specialists. In severe cases, treatment requires a total redesign and refresh of content. If you have never attempted to treat content type madness, BACK UP THE DATABASE BEFORE YOU TRY.
The good news is that content type madness is easily prevented by following a few rules of thumb:
- Remember: every new content type you add is another demon, that requires a new set of CCK fields, content defaults, and often node-[type].tpl.php files.
- Never use a content type when a taxonomy term will do. For example, news, press releases, alerts, and announcements can often live in one content type, with a vocabulary specifying the difference. Clients will often find this approach easier in our experience.
Don't forget, content types are not always a sign of the disease, and can proliferate in perfectly healthy drupal sites. Examples of healthy content types:
- Types that are defined by a module (e.g. panels, webforms)
- Content types with different permissions (e.g. press release vs. community forum posting)
- Content types that require a unique set of custom fields .
- Content types that require a design that deviates from the standard.
- When one content type inherits fields from a parent content type. E.g. Show Vs. Episode.
Adding new content types is always evil, but sometimes is a necessary evil. In all cases, try to make it work within one content type before you add a new one.
* [ insert overused movie quote and reference here ]