A Foot in the Door

Making Sense of Drupal Development

I distinctly remember my initial impression of Drupal: “why in the world would I use this?” Roughly 2 years ago, Drupal was a confusing landscape of terminology, technology and arcane methodologies – to me, at least. For a time, I considered treating it strictly as a job requirement, and avoiding it on a personal level. Luckily, my stubborn nature got the better of me, and here I am, extolling the virtues of Drupal, practically on a daily basis. What prompted this radical shift in perspective?

I suppose it would be best to start with where I was 2 years ago, which is also where I expect many “all purpose” web design industry employees were. Our industry is somewhat unique, in that many of the people who perform a specific role at their job, also perform most or all of the roles their company employs, when they build sites for friends, family, organizations and businesses. As a result, many of us are versed in a wide array of skills necessary to plan, build and host a website – the full logistical gamut, if you will.

This generally includes simple server administration, knowledge of markup (HTML, CSS), basic programming, some database planning and graphic design. Many people would consider these to be, more or less, the “essentials” of web design. And indeed, they are quite essential for typical web development. However, Drupal is far from typical. Even with considerable exposure to and experience with all of the above essentials, it can be a beast to learn.

How is Drupal different?

At its heart, Drupal is 2 things: a content management system (CMS) and a development platform. CMS’s could be considered another “essential” of web design these days. The technology has permeated our industry so deeply that it is not unusual to hear someone say that it should be treated as a mandatory requirement for most sites.

Drupal as a Content Management System

The holy grail of programming and database work that is done in our industry, is to produce an end product that is not only easy to administer, but is, in fact, so easy that the client themselves can administer it. This reduces client costs across the board – by performing site updates themselves, clients save money. Further, if we are asked to perform the updates instead, we can do them in less time.

This is accomplished by producing restricted administration areas on the site. For example, you might have areas to post articles to the site or to edit pages. To do this, you must to log in to the site. Once logged in, you may have permission to edit pages, but not to create or delete them. This is the essence of content management: clients log in, and have limited ability to update what’s on their site.

Drupal “core”, meaning Drupal as it is after a basic installation from drupal.org, includes all of this capability, and more. Upon installing Drupal 7, for example, you have the ability to log in and then create, edit, delete and view both articles and pages. Drupal core also includes some optional functionality that can easily be turned on: forums, polls, blogs, etc.

So, we’ve established that Drupal is a CMS, but as I mentioned earlier, Drupal is also a development platform – and that is where Drupal both distinguishes itself and becomes vastly more versatile and complex.

What is a Development Platform?

A development platform isn’t something that most clients are aware of, or can appreciate. Imagine a painter who is looking to draw an intricate garden scene, complete with towering trees and beautiful flowers. Now, imagine that same painter, but take away most of his colors and brushes. At the expense of my dignity, let’s use a visual reference.

Now, isn’t that just awful? I mean, it has a couple of happy trees, but all in all I don’t think anyone’s going to pay money for it. It’s what I imagine a good painter could do with one, fat brush and only 4 colors (in retrospect, a good painter could probably do much better in that scenario).

Tools can make all the difference in the world. As you can see, in the actual painting* I was attempting to imitate, a broader set of tools can result in a vastly superior product.

You see, a development platform provides developers with tools to more efficiently and easily create robust functionality for a web site. When I first encountered Drupal, I felt much like I was painting with too few tools – or in this case, developing with too few tools. In fact, I initially felt like there were no tools at all! I fully understood what Drupal did “out of the box” as a content management system, but I hadn’t been introduced to the tools it has as a development platform.

Over the course of 2 years, a variety of people who are knowledgeable and experienced in working with Drupal, have imparted that knowledge to me, and now, I’d like to share some of it with you.

A Drupaler’s Tool Belt

I believe the most valuable information someone new to Drupal can be supplied with, is a punch list of the things you’d otherwise have to discover through word of mouth, trial and error, or extensive research. Since there’s so much ground to cover, I’ll try to be succinct with each topic. You can learn more about any of these by searching online.

Point and Click Development

When I first began working with Drupal, this was an entirely new concept to me. The idea that content could be created, stored, modified and displayed without a single line of programming bordered on sheer joy. I honestly believe that if the Drupal community were more proactive in marketing this functionality to developers, there would be a lot more Drupal developers. So, how does it work?

There are 4 conspicuous modules that comprise what I consider to be the basics of Drupal point and click development:

  • Content Creation Kit (CCK)
 - Allows you to structure a kind of content to be managed on the site, using fields. Each field can have its storage and display configured. This is the rough equivalent of building database tables.
  • Taxonomy - 
Allows you to organize content by classifying and tagging it.
  • Views
 - Views is not included in Drupal core, but it is the single most downloaded module for Drupal. It allows you to display content to site visitors dynamically, as lists, blocks, grids and more. This is the equivalent of database queries and programming loops.
  • Permissions - 
The permissions module allows you to define who can do what: create content, edit it, delete it, view it, etc.

For a less technical, but more verbose overview of point and click development, take a look at my first blog.

Contributed Modules

A community of over 18,000 developers supports Drupal. Those developers have created over 15,000 modules. With a simple download, the flip of the switch and minor configuration, modules can add functionality to a Drupal site that would take days, months or even years to develop on your own.

Over the last 2 years, I’ve often thought that most Drupal point and click developers are the sum of their module repertoire. The more modules you are aware of and know how to use, the more complete your Drupal point and click development skills are.

My previous blog discussed a contributed module called “features”, which I highly recommend. I’ll likely discuss some other modules in future blogs.

Drupal.org makes it easy to start familiarizing yourself with commonly used modules, by providing a listing that is sortable by “most installed”. Take a look!

Distributions

In addition to Drupal core, there are many distributions of Drupal geared towards specific needs and/or industries. Oftentimes, selecting an appropriate distribution can save an incredible amount of time and effort for a web site. They include suites of modules and custom development all intended to work together, and tested with that intention in mind.

Drupal.org makes it easy to familiarize yourself with distributions, as well.

The Hook System

Look out folks, we’re venturing into the depths of Drupal now. For those that want to extend Drupal, or to do things that can’t be accomplished strictly with point and click development and contributed modules, there’s the hook system.

Drupal’s hook system is your “in” to PHP development in Drupal. It’s an event-based model allowing you to inject code when specific events occur, as well as to gain access to information related to that event.

While worth mentioning, the hook system is definitely outside my area of expertise. If you’re interested in learning more, take a look at the documentation for it.

Command Line Administration with “Drush”

Drush is an unsung but ever-present hero in the Drupal community. I pity developers who don’t know about it, and I wish I knew more. Those familiar with and fond of command line interfaces (CLI) know that there’s no substitute for the efficiency of a command prompt for many simple tasks, and drush certainly holds true in that respect.

When installed on your local, development or production environment, Drush provides quick access to a variety of functionality such as installing Drupal sites, clearing caches, running database updates, installing and managing modules, creating and managing users, and more.

As a quick example, here’s the manual process for installing a module:

  1. Download the module from drupal.org.
  2. Open your site/server in a file transfer program.
  3. Upload the module to your server.
  4. Enable the module on the module administration page on your site.
  5. Run database updates using a site administration page on your site.
  6. Clear the site caches using a site administration link on your site.

Here’s the same process using drush:

  1. drush dl module_name
  2. drush en module_name
  3. drush updated
  4. drush cc all

Manual installation of a module could easily take several minutes or more, whereas those drush commands can be executed in 15 seconds. Drush can also be used remotely over SSH, when you are not in a position to interact directly with your site. If you’re comfortable at all with CLI, drush is the way to go.

It’s Worth the Effort

Stumbling across Drupal for the first time can be a harrowing experience. Without awareness of its incredible prowess, it can even drive away or disappoint developers. However, a developer equipped with the knowledge and skills to use it can accomplish remarkable feats of efficiency and functionality.

If you’re interested in learning more about developing with Drupal, find a Drupal conference or camp near you. They usually include a beginner’s course or session that will give you a more practical overview of many of the things I’ve mentioned here – and remember, Drupal is, first and foremost, a community. Never be afraid to ask questions!

*http://commons.wikimedia.org/wiki/File:El_jard%C3%AD_de_l%27autor,_Josep_Benlliure_Gil,_Museu_de_Belles_Arts_de_València.jpg