When does content type count get ridiculous?

Located in:

This is just a small, personal site built for experimentation and fun, but I already have 8 content types to choose from when I want to add a new article. Without fact checking, I think Drupal has about 3 content types (Page, Story and Blog?) when freshly installed. However, the templating system in Drupal is so powerful and, dare I say it, intuitively structured that - once you get it - it's easy to have an explosion of content types and corresponding template files to suit your needs. But when does it get out of hand?

Template naming goodness

Drupal allows you to create different template files to pretty much any granularity/specificity you like. If you really wanted, you could give each and every node a different layout/colour scheme by creating a correctly named template file. For instance, if your node id is 13, all you need to do in your theme is pop in a "page-node-13.tpl.php" file (assuming the default PHPTemplate engine is being used). Drupal automatically sees the new template for that piece of content and uses it to render the page. Super easy!

However, we all know that with great power comes great responsibility. What happens if you have gone on a content type binge and you have dozens of template files for your theme? Each new template is a separate file that requires separate care and if there are shared elements between the template files, then changing one means having to change all the others. All of a sudden, a simple layout change might need to be done across tons of template files and then each one of those needs to be tested, just to be sure your site's layout is consistent.

Hey, it's not 1:1

Let's be clear, you don't need to have a separate template file for each new content type, but it's a pretty straightforward logical process. For example:

  1. Client wants press releases displayed with article "created" date instead of article "last updated" date.
  2. Create a "Press Release" content type and add a new template file that displays only the "created" date.

Easy to do and if your site has a lot of varied content, it's not hard to imagine those two steps being repeated over and over until your theme folder has dozens of tpl.php files. A (possible) maintenance nightmare.

So back to my original question: when does the number of content types on a site get ridiculous? At what stage is the maintenance of template files not much better than the management of a static site? Okay, it probably wouldn't ever go that far, but each new template file can take you one step further from one-stop site maintenance. That's something to keep in mind just before step 2 from above.

No votes yet
Your rating: None

Social mediatize it!

Twitter Twitter Facebook Facebook     
How about that! I'm a Drupal association member.

Attention IE user!

It turns out you are using an outdated browser and my site might look a bit weird for you. (images are off colour, text gets cut off, layout is wacky) This is because your browser does not implement web standards. Please consider an upgrade.

Alternatively, you can try other browsers like Google Chrome, Mozilla Firefox, Opera or Apple's Safari. Every web developer on the planet will thank you! (and that's not really an exaggeration)

Hide this notice for the rest of your visit