Drupal is Cake

Wed, Mar 11, 2009 by Scott

A layer cake. One of the biggest hurdles you'll encounter when learning Drupal is trying to figure out what goes where, what gets executed when, what makes a module truly modular, and what makes a theme a theme. It all gets jumbled around in your mind at first and it makes for a difficult time when trying to implement an idea. It leads to the dreaded question 'where do I start?'.

The layers of Drupal make sense in theory but it really doesn't become completely clear until you've had some good challenging hands-on experience. What is important to know is that Drupal keeps markup, data, and functionality all separate. The foundation of Drupal is the database layer. It holds all content, module, theme and block settings. Above the database layer are modules. The modules act as a revolving door between the data and the theme. They either receive user input, process it, and store it in the database; or they retreive data from the database, process it, and pass it to the theme.

With this, we can analyze our task and determine where to implement it. For instance, if you want to change a field label in a form you need to use hook_form_alter. But where does it go? Thinking back to our layers, we know that we can't edit it at the theme layer because it's too late...it's already been outputted. We have to 'hook' into drupal and intercept this value before it gets sent to the theme, so we put it in a custom module.

Applying this logic to your projects will help keep things in perspective. It really just comes down to simplification.

פומה posted on November 16, 2009 3:58 pm

I like Joomla and Drupal.. Yet, Wordpress is definitely my fav.

Arnold posted on March 21, 2009 8:12 pm

What platform do you guys use for your sites?

Steve DeVries posted on March 20, 2009 11:02 pm

Drupal is definitely worth learning despite the learning curve. I always suggest web developers at least give it a chance. I've loved being able to use it.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <h2>
  • Lines and paragraphs break automatically.

More information about formatting options