fromSeptember 2013
Column:

Drupal In Context

Does Coding Matter?
0

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

Do It Yourself
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.

Image: http://www.istockphoto.com/vector/diy-doodle-10395414?st=2fdb85c

Advertisement

From our blog

Entity Storage, the Drupal 8 Way

In Drupal 7 the Field API introduced the concept of swappable field storage.

The Drupal 6 to 8 Upgrade Challenge - Part 2

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.

The Drupal 6 to 8 Upgrade Challenge - Part 1

Nathaniel Catchpole , the Drupal 8 release maintainer and Tag1 Senior Performance Engineer, suggested that Drupal shops everywhere could support the

DrupalCon Austin

The entertainment industry is not for the faint of heart.

Drupal Watchdog Joins the Linux New Media Family
Drupal Watchdog 6.01 is the first issue published by Linux New Media.

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.

Welcome to DrupalCon Barcelona - The Director's Cut

For all you schedule-challenged CEOs – and ADHD coders – this Abbreviated Official Director’s Cut is just what the doctor ordered.

Welcome to DrupalCon - The Barcelona Edition

Did we have fun in Barcelona?
OMG, yes!

Did we eat all the tapas on the menu and wash them down with pitchers of sangria?
Yes indeed!

Recursive Closures and How to Get Rid of Them

This came up while manipulating taxonomy children and their children recursively, so it’s as not far from Drupal as you’d think.