Tutorials

Installing Acquia Commons on Acquia Dev Desktop

As part of a Drupal workshop that I'm teaching (the Drupal Career Starter Program), we've been discussing Acquia Commons. Our discussions led us to decide to have a local meetup specifically to learn more about it.

Since we expect a number of newbies at the meetup, I figured I post a quick video showing how to get Commons up-and-running using Acquia Dev Desktop. I found it to be a little bit tricky, mainly because the memory requirements for Commons are a bit higher than for core Drupal. The video shows how to tweak a couple of memory setting in the php.ini file.

NOTE: If you're using the Windows version of Acquia Dev Desktop, you can ignore the "apc.shm_size" change - it isn't used in Windows!

Taxonomy Term Pages on Steroids Using Panels and Views

Creating a well-organized, content-heavy website is difficult. Creating one that is also sustainable is even trickier. It's easy to keep adding features to a web site without considering how they fit into the overall plan until you get to the point where things start getting out-of-hand and site maintenance starts becoming a real issue (blame Drush for making it so darn easy to add new modules!)

Fast and Safe Module Updates with Drush and SVN

SecurityOne of the primary ways of keeping a Drupal site of any size running securely and at peak performance is to ensure that all of its modules stay updated. With thousands of modules in the Drupal eco-system, updates are released literally every day. Luckily, Drupal core's Update Status module helps site administrators keep notified of modules in need of updating.

In this article, you'll learn how to use the power of Drush and Apache Subversion (aka "svn"), a revision control tool, to update your site's module quickly and safely. You'll be presented with two methods for solving the problem. The second method is much faster, but comes with a caveat. Read on.

Creating a Directory of Public Features Servers

In an attempt to point to some of the great things that are available using Features, I tried to look for a directory of Feature Servers. Sadly, Google was not very helpful. After some digging, I was able to locate a page on the OpenAtrium Community site called Distributed Feature Servers. This points to many of the other pages I was able to find via search.

Utilmately I created a wiki page on the Packaging & Deployment group of groups.drupal.org, which seems to be one of the hottest places to discuss Features.

Directory of Public Features Servers wiki page

Currently, there is tons of info about how to create your own Features Server, but not much about where all the publicly available features servers are located. If you know of others, please go edit the wiki page on groups.drupal.org or leave them in the comments here.

Theming Nodereference - or - Reusing Complex Data in Drupal

This is your moment, you've decided to step up and make a job board for your local Drupal User Group. You spend some time thinking about everything you'll need, including the job listings themselves. You'll want to gather the standard info, like job title and job description, salary, experience, the works. When it comes to gathering company info, your instincts make you take a few extra moments to plan.

If you think about this from the perspective of the person posting 6 or 7 jobs, she would end up having to type (or at least copy and paste) the business' contact information each time. If you think about collecting 3 or 4 fields for each business, then that's about 20 extra form fields for the user to fill out. If she then decides to change the info, let's say she made a typo, she now must click through each edit screen 6 or 7 times. That amounts to hundreds of clicks and several hundred repeated keystrokes.

job content type with company info baked in

There must be a better way. A nodereference can help your users.

Once finished, you will have two nodes, one for a job and another for a company, and yet you will still display the information about the company inside the job listing.

final themed job listing

By the end of this tutorial, you should understand what a nodereference is for, how to create and use one, and finally, how to use template files to theme the output of the nodereference and get the most out of the relationship.

Using Views Relationships, Arguments, and Attachments

This article is also available in French from KolossalDrupal.

There's an incredible amount of functionality that can be provided by the Views module, especially when it is combined with intelligent use of Node Reference fields. When you relate your site's nodes with Node Reference fields, these relationships can be easily leveraged to create some very useful views.

I'm going to build a view for a sample music site. In the site, I have 3 related content types for "Band" nodes ("Black Eyed Peas", "Linkin Park", etc...), "Album" nodes ("Back in Black", "Bat Out of Hell", etc...), and "Events" (concerts, television appearances, etc...)

Content Type relationships

RDF in Drupal: What can I do today? Drupal 6 and the Semantic Web

In the first three parts of this series, we've looked at what RDF will do for you as both a consumer and a provider of RDF data and we've had a quick primer on what exactly implementing RDF entails. Turning our attention back to Drupal, this article will take a look at the state of RDF in Drupal 6 and some of the available contribued modules. Tomorrow's article will take a look at what the next version of Drupal will offer in terms of RDF.

Drupal 6 does not have any RDF functionality in core. If you want to implement anything having to do with RDF in Drupal 6, you'll need to utilize contributed modules. Only a few of the RDF-related contribued modules for Drupal have even had official releases - the majority of them are still somewhere in the development process.

While reviewing the existing RDF modules for Drupal 6, I found that I could categorize them into two categories - "Provider Modules" and "Consumer Modules". Those in the former category are designed primarily to help you RDF-ize your site's content. Modules in the "Consumer" category are generally designed to help you consume, use, and display RDF data from various sources. In some cases, there is some overlap, so this categorization is more for convenience than anything else.

RDF in Drupal: Super-Simple Primer

If you've read the first couple of installments of this series, you should have a pretty good idea of what the "semantic web" is by now. By providing precise meaning to a site's content, applications can take advantage of these machine-readable hints to link data together across sites in a myraid of ways. Before you jump in the deep end of the semantic web pool, there's a few more things you should have a clear understanding of.

As I previously defined, RDF stands for Resource Description Framework. This is a family of standards for describing content on the web. The vast majority of current and future Drupal implementations of RDF are actually RDFa (Resource Description Framework in Attributes), a set of extensions to XHTML. RDF is normally implemented using XML; while this is possible with Drupal, RDFa allows Drupal to implement RDF as part of the standard content displays.

RDF in Drupal: What is it and Why Should We Care?

RDF. Semantic Web. Giant Global Graph. Food for Robots. By now you've probably heard all of these phrases, but relatively few of us have actually done anything with them. For example, I try to follow all the RDF modules on Drupal.org, read all the blog posts regarding Drupal and RDF but I've yet to implement anything having to do with RDF on any of the sites I develop or maintain. Why is this? Am I behind the curve?

The answer is two-fold. First, I have yet to have any clients specifically ask for RDF functionality in their web sites. Secondly, I hadn't been convinced that recommending that my clients spend the time and money to implement an RDF solution is a sensible move for them. The reason I decided to research and write this series of articles is to figure out if and why I should recommend implementing RDF functionality to my clients.

Prior to performing the research for this series, my knowledge of RDF was limited to water-cooler-conversation type knowledge. Big on bulletpoints, small on details. I was aware that RDF will, in the future, be used by search engines to provide better search results. I was also aware that by "tagging" web site content with RDF would enable a "richer" experience. The one example I would relay to people was a vCard-powered business card embedded on a web page using microformats that allowed the user's computer to do something with the contact information. Amusingly, it turned out that my one RDF example didn't even involve RDF, and that the vCard format was actually called hCard when used as a microformat. I had a lot to learn.

Case Study: Building and Theming a 3,000 Article Site in 37 Days.

It could have been an April Fools joke.  On April 1st we got the call. "We have mockups for the design of the site, and we need the theme done in 2 weeks. After that we can discuss the XML import part of the project. We need to go live at the beginning of May."  We knew it would be a challenge, but we made it happen - on May 7th the site went live.

resources.yournaturaloptions.com home page

Using Node Reference Fields with the Node Import Module

This article is also available in French from KolossalDrupal.com.

The extremely useful Node Import module has been around for over 4 years now - which is an eternity in Drupal-land - but in recent days other newer, shinier import modules have hit the scene. While these modules certainly are useful for many applications, sometimes the tried-and-true works just fine. In this article, I'm going to show you how to use the Node Import module to import data in CSV format (comma separated values) and map that content to existing content types that include node reference, text, and integer fields - including multi-select checkboxes.

On Drupal Performance: Testing with Apache Benchmark

Sometimes in our lives, we all have pain, we all have sorrow. And sometimes we also have to launch Drupal sites into the wild blue yonder. It's during these times that we separate the grown-ups from the n00bs, and we see how well our site performs under heavy load. Many of us didn't need to worry about speed, page size, and server load in our younger years when we were building sites for Uncle Don and Aunt Sue, but eventually you get that big client, and you need some help.

Testing your site's performance

There are several ways to test, and a few metrics to acquaint yourself with. Not all metrics are created equal, but all of them are important at one time or other. In Part I of this post, you will be reading about testing with the Apache Benchmark tool on the command line.

Apache Benchmark

Adding Rounded Block Borders to Your Site's Theme

Rounded corners are all the rage - and they have been for quite some time in web design. The way they "soften" up a design make them quite attractive to designers and decision-makers. Unfortunately, implementing rounded corners in a web page is not nearly as easy as it is to implement in a mockup using an image application.

When talking about rounded corners, there are 2 distinct user cases to be considered - the first is when creating rounded corners only on the top corners of an area - this is commonly seen on tabs and block headers. The alternative use case is when all four corners of an area are rounded - this is usually seen in blocks and around content areas. This article will focus on the the case where all four corners need to be rounded. The result will be a method of adding the ability to optionally apply a rounded border to any block on your site in a way that doesn't break when the block is resized.

Tabs with 2 rounded corners and a content border with 4 rounded corners.

By the end of the article, you should be able to add this option to just about any Drupal theme - the relevant files you'll need are available for download at the end of this article.