Content Type Madness (CTM): Symptoms, Treatment, and Prevention

05.21.2009

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:

  1. More than 11 content type*
  2. Dubious distinctions between content types [e.g. press release, vs. annoucement, vs. news item, vs. alert]
  3. No use of drupal taxonomies
  4. Overuse of views
  5. Users of site reporting feelings of malaise, and depression after working with content on the site.

Frequent complications of content type madness include:

  1. Improperly set content defaults, ranging from internationalization, to comment settings, to publishing workflow, to user permissions.
  2. Presentation inconsistency due to the proliferation of node-[type].tpl.php files.
  3. Switch statements that exceed 200 lines in the hook_preprocess_node(&$vars) function in the template.php file.

Treatment Options:

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.

Prevention:

The good news is that content type madness is easily prevented by following a few rules of thumb:

  1. 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.
  2. 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.

Misdiagnosis

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:

  1. Types that are defined by a module (e.g. panels, webforms)
  2. Content types with different permissions (e.g. press release vs. community forum posting)
  3. Content types that require a unique set of custom fields .
  4. Content types that require a design that deviates from the standard.
  5. When one content type inherits fields from a parent content type. E.g. Show Vs. Episode.

Conclusion:

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.

Notes:

* [ insert overused movie quote and reference here ]

Comments

I have a closely related

I have a closely related question concerning content type madness.

In playing around with different options to create a photo gallery, I've installed and un-installed several different modules. Now I have my gallery built the way I want it.

The problem is that when I go to Create Content, I see two content types that should not be there. These content types don't show up in Admin > Content Management > Content Types (which is good). However, they show up when I click on Create Content. They also do not show up in User Permissions.

Here are the content types that are showing up in Create Content:

Gallery (Node Gallery)
This is a gallery (album). This will be the parent of your individual images.
Image
An image (with thumbnail). This is ideal for publishing photographs or screenshots.

How do I remove these content types entirely? Thanks.

What about OG? I understand

What about OG? I understand and appreciate many of the arguments for taxonomy over content types, but when you bring OG into the mix, I lean heavily towards content types. It's so much easier to manage when you have a type that can be posted into a group.

That probably falls under the

That probably falls under the "different access control needs" clause.
[section 3.2.1 delta victor victor - of my fat head's rules on when to create a new content type]

Sheesh. Only 11? I've got a

Sheesh. Only 11?

I've got a handful of contrib modules and 3 CCK content types and that gives me 16 total. And I'm not done yet.

11 seems like too low a number. Heck, the core types plus some poll types gives you 8.

What's this about content

What's this about content type inheritance?

I think there's a lot of good

I think there's a lot of good points here. I've seen projects with as many as 25 different content types, many of them used for one-off special pages like a contact form.

Like Merlin, I try to minimise it, and use Taxonomy, CCK or a module-defined node attribute for distinguishing different sub-types.

Also, I'd highly recommend taking at least the most important content type down into a custom module, especially if you have a lot of fields. More than 5 CCK fields on a node type quickly becomes unmanageable.

Eh. Taxonomy is a disease.

Eh. Taxonomy is a disease. Use a 'type' field on the content or something, if that's what you want. Taxonomy is a hideously overloaded concept that tries to do too much with a poor data structure and it makes people cry when they think it should do these really simple things and it turns out it's hard because the data structure needs to support 29837498 other things making that simple thing impractical.

Using taxonomy for things other than actual tagging or hierarchical categorization is IMO bad.

Yeah -- but you'll have to

Yeah -- but you'll have to program in, or set up a "type" argument in views to make any use of it. Auto-generated menus would also need to be programmed (and that doesn't look fun). I don't know if I see the advantage of using a "type" field over a "type" vocabulary given that at least there's a half a dozen decent modules that extend taxonomy.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.