Mikkel Høgh

Coding the web since 1999

15 Jun 2009

Things that should be objects in Drupal #1: Content types

Currently, defining the simplest content type in Drupal requires ~54 lines of 100% standard boilerplate code.

The reason Object Orientation would be good here is the simple concept of inheritance.

Very simply, my 54 lines of code could be replaced by something like:

class CampaignContentType extends NodeContentType {
  // Custom functionality here.

I think I’ll go see if I can help Crell with his objective somehow :)