Home

An Introduction to Drupal

Here at CCIT, we use Drupal for just about everything — including the Web site you're reading right now. I spend most of my day in Drupal, we talk about Drupal with our clients at just about every meeting, and I even spoke about it at Do It With Drupal. By now, if you're not already using Drupal you're probably wondering what all the fuss is about.

Drupal is a really good content management system that just so happens to be free ("free" as in "free kittens" not as in "free beer".) It provides a framework to create really amazing Web sites that have dynamic content and intuitive (or at least familiar) interfaces. User account management, permissions, and interactivity are all built-in.

All this comes at a price, and that price is a non-intuitive conceptual model. This manifests itself as steep learning curve of jargon and unfamiliar terminology for site managers and odd coding practices for developers. This guide is here to try and help you conquer that learning curve.

The Basics

Nodes

Before you figure out anything about Drupal, you need to understand Nodes. Nodes are Drupal's unit of content. Pages on a Web site, an article in a magazine, a photo, an online form, a job posting, an auction listing, all of these things could be types of nodes on a Drupal site. The majority of URLs on any given Drupal site ultimately point to a unique node. 

Nodes store information like the title and body of this blog entry. They also store who wrote it, what time it was written, if it was ever updated and at what time, what tags are associated with it, any attachments and where they're stored, if comments are enabled, if the entry should be published, etc. At the end of the day, no matter what your site is supposed to do, Drupal's main job is to display nodes.

Blocks

If you go to any blog or new site, you'll notice that when you're reading an article, there's a lot more on the page than just the title, body, and author of whatever you're reading. There's probably a menu, some boxes with other featured content, a list of tags, or maybe even some ads. In the world of Drupal, these boxes are stored blocks. They're not as robust as nodes because they don't have to be. They're just little snippets of content that can be placed on a page layout as auxiliary content.

Blocks can display menus, advertising, user information, and even content from other nodes. More on how to do that later.

Modules

In the world of Drupal, Modules are plug-ins. They are the meat and potatoes of what makes Drupal such an amazing content management system. Most of the things you'd ever want to do with a Web site are already Drupal modules.

When you're setting up a site, rather than sitting down and talking about how you're going to develop it, you instead go shopping for modules, and then try them out to see which ones fit the bill. There are modules for voting on things, modules for integrating with Facebook, modules for adding videos to your site, even modules for turning your site in a cash register. Best of all, all these modules are free. This is one of the most exciting things about Drupal, and the thing that easily saves the most time when you're setting up a site.

For the purposes of learning, it's useful to know that even the most basic parts of drupal's functionality are modules (called core modules). Some are so basic to Drupal's functionality you can't turn them off (yes there's a Node module).

Themes

Themes are essentially the templates that wrap everything up and make it look nice to the outside world. They're usually broken down into a main page template, and templates for all other types of content (blocks, comments, and of course nodes). These templates are written in PHP and follow some conventions so that they are easier for designers to read. They're bundled with CSS and frequently JavaScript to make designs that are as pretty as they are responsive. They can also contain display logic and sometimes some pretty intense code.

Taxonomy

Taxonomy is essentially what Drupal calls tagging. You can also use taxonomy to label content by audience, by department that's responsible for maintaining it, by what color socks you were wearing when you wrote it, etc.

10 Modules We Can't Live Without

Drupal does not live by core modules alone. There are certain things you will probably need for just about any site you build in Drupal, but you have to know about them and install them first. These are the modules we here at CCIT use for just about all our sites, and just like the heading says, can't (or at least wouldn't want to) live without.

1. Content Creation Kit (CCK)

So you've just installed Drupal and you're really excited to start creating some node types. You're looking to create a job posting site, where employers enter the job title, salary range, location of the job. As you go to the new node type screen you're frustrated by the lack of options. You already change the node title from "Title" to "Job Title" and the node body from "Body" to "Job Description", but you need more fields.

CCK to the rescue! Lets you add as many fields to nodes as you want, and can customize how the information is entered and even say what values are allowed. CCK is so essential to how most Drupal sites work it's going to be included with the core modules in a future version of Drupal. For now, you have to download and install it manually.

2. Views

Another module that's headed to core is Views. Why is it too considered so essential?

Let's stick to the job posting site example. You just used CCK to create a fantastic node type with every field you can imagine. You create your first job posting node and it looks great, but you want to display lots of jobs at once, letting people search and sort them by different criteria so that they only view job postings they want. If that's what you want to do, then Views is the module for you.

Views lets you pull information about nodes, users, and other things together into a flexible display that can be used on a page or a block. The information can be displayed as a table, a list, a grid, or any number of other ways, and can be dressed up with fancy CSS and JavaScript. It can also be filtered dynamically by the end user, allowing for search functionality.

Once you understand and master views you can do all sorts of really amazing things that would otherwise take a long time to develop. Some examples of Views we've created:

3. WYSIWYG API

The ultimate goal of any content management system is to allow for non-technical users to create and edit Web content. It turns out that people are most comfortable doing this in an interface that is as much like Microsoft Word as possible. Enter WYSIWYG API, a module which allows Drupal to use any number of great WYSIWYG editors out there and integrate them seemlessly onto your existing sites.

4. Image Assist / Image

There are a lot of online tools that set a pretty high standard for image placement and manipulation online, and Drupal definitely doesn't have those features out of the box. Fortunately, there are a number of unrelated modules that allow Drupal sites to store and display images. Image Assist provides an easy interface for users to easily insert images within content with inline captions and a ton of other options. It's definitely the image solution with the best learning curve, so we use it on our sites by default unless another image interface is required. In those situations, we usually go with a combination of Image cache, Imagefield, Imagefield Crop, and Lightbox2, which are all also exceptionally good modules as well.

5. Admin Menu / Simple Menu

Both of these modules provide pull down menus at the top of the screen when you log in as an administrator. The benefit? You can have a robust administrator interface without it breaking your awesome page layouts. Each of these modules work slightly differently and is therefore useful in different situations.

6. Token

Tokens basically let you quickly refer to aspects of nodes and users like variables in an equation. This functionality comes in handy for a number of other modules on this list.

7. Rules / Revision Moderation

Rules rules! Seriously, Rules allows you to set up events that happen on a site at key times, so that "when ____ happens, do ____." This helps fill in a number of gaps within modules that are otherwise very useful. You can also use it to set up a moderation queue so that all changes on the site have to be signed off by an administrator.

Revision Moderation does this revision queue/approval mechanism extremely well. So well, in fact, that we'd use it on all our sites (and give this module its own line), if only it worked in the latest version of Drupal! Alas and alack, Rules will have to do until then.

8. Path Auto

Path Auto makes it so that all nodes get URLs that make sense. So, for example, a blog entry gets the URL "blog/tm2336/an-introduction-drupal" rather than "node/211". You can also use tokens, so the URL for this page could just as easily be "blog/2010/04/an-introduction-drupal".

9. Custom Breadcrumbs

Custom Breadcrumbs does for breadcrumbs (i.e. the "you are here" line on most web pages that shows you how to get back to "Home") in Drupal what Path Auto does for URLs. You can set breadcrumbs for any node type, so that on a blog you can have the following breadcrumb:

Home > Blogs > An Introduction to Drupal

Again, you can use tokens, so following up on the Path Auto example, you could also have the breadcrumb:

Home > Blogs > 2010 > April > An Introduction to Drupal

10. [Your Module Here]

We've created a number of our most essential modules here in our own shop. Most of these modules integrate with existing University resources that handle calendar information, course information, student data, and authentication. The fact that we've integrated this many separate systems is a testament to Drupal's flexibility and adaptability.