Drupal In Context

For non-programmers like me, Drupal's biggest flaws show up when a site is almost right, but needs “just a few lines of code” to really make it work. Some people learn programming easily; others can't, or don't want to invest the time. Fortunately, there are Drupal tricks to get many of the benefits of programming without having to actually deal with PHP, CSS, or JavaScript. Here are some that'll get you most of the way there.

Refactor Your Problem

Whenever you run into a brick wall, stop, step back, and ask yourself: Does my site really need to have this feature? Could it be done in a different way?

Many times when I do this, I realize that I've had a specific idea in my head as to how something should work, rather than the end goal I'm trying to achieve. Stepping back to look at the site from a visitor's point of view often shows me a simpler way to produce what's needed — even if it doesn't work anything like my original idea.

Use the Megamodules

Most modules perform a specific task; "megamodules" give you ways to manipulate Drupal's inner workings through a simplified visual interface. The best-known is Views, which helps site builders deliver the results of a database query: in essence, it translates your point-and-click directives into SQL. (Views will be part of Drupal 8’s core package.)

But Views isn't the only megamodule out there.

Rules lets you create logic that reacts to actions by users;

Panels replaces tricky PHP theme templating in some cases;

Features packages site elements into a custom module;

Sweaver writes CSS for your theme, reflecting changes you make in a visual interface.

Learn What Programmers Do

Even if you don't plan to actually write code, getting to know the tools that programmers use will help you in two ways. First, you'll be able to implement code written by others; second, you'll be able to frame the problem better when you interact with programmers.

Learn the essential commands in *nix — that is, Unix or Linux. The overwhelming majority of Drupal programming and system development happens on a *nix operating system. If you have a Mac, you already have Unix installed; just open the Terminal program to access it. (If you're on Windows, your web host probably runs Linux on the server. You can access it over SSH using a free terminal program such as PuTTY.) If nothing else, learn commands such as: ls, cd, cp, mv, tar, wget, and man;

Play with Git, a version control tool that's used to create and apply software patches. The easiest way to see how it's used with Drupal is to go to any module's project page and click the "Version control" link at the top for instructions;

Read the issue queues of the modules you use to understand their shortfalls — and what's being done to address them.

Finally, try not to get frustrated. Although Drupal is expanding aggressively into the realm of development platforms like Ruby on Rails, the Drupal community knows that tomorrow's greatest contributions could be great in ways that don't include coding — they could come from designers, project managers, businesspeople, and so on. For your own site, the proof is in the pudding: when a site is terrific, nobody cares whether it's custom code or well-applied modules that made it that way.

Tom Geller has been online for twenty-five years, and building Web sites for fifteen. He switched to Drupal in 2007 and has since created eight Drupal video courses for lynda.com, written the book Drupal 7: Visual QuickStart Guide, and consulted on communications for Drupal companies. His home is in Oberlin, Ohio; he's online at tomgeller.com.

Having concluded the readiness assessment, we turn next to migrating the content and configuration. In reality, there’s little chance that we would migrate anything but the blogs from our old site. For the sake of giving Migrate in Core a workout with real conditions, however, we’re going to upgrade with core’s Migrate Drupal module rather than rebuilding.

Drupal Watchdog 6.01 is the first issue published by Linux New Media. Come see the Drupal Watchdog team at DrupalCon 2016!

Drupal Watchdog was founded in 2011 by Tag1 Consulting as a resource for the Drupal community to share news and information. Now in its sixth year, Drupal Watchdog is ready to expand to meet the needs of this growing community.

Drupal Watchdog will now be published by Linux New Media, aptly described as the Pulse of Open Source.