Mikkel Høgh

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

Monday, June 166th, 2009

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 :)


Mikkel Høgh

My name is Mikkel Høgh, I've worked with web tech for the last 20 years. These days, I work with e-commerce in Central Switzerland.