Dan Brickey in Galway, or how to get Drupal'd in a few hours

This week we had Dan Brickley visiting DERI. Dan co-started the FOAF project in 2000, and is also involved in the SIOC project which is mainly based here in DERI. That was the occasion to have several sessions of brainstorming about various aspects of SIOC including dataportability (John presented his slides), the recent change in the Dublin Core ontology, URIs and best practices for publishing SIOC data, and finally some domain modifications (some of them came from the Drupal RDF Schema I've been working on). This lead to a few changes on the ontology. A digest of these sessions is being written.

While he was in Galway, Dan expressed an interest in Drupal, which is already used on sioc-project.org. We had a few opportunities to meet and I demoed him the flexibility of this great tool. Laura joined us for a bit, and I thought it could be useful to share this, so below is the rundown of what we did in a few hours.

Let's start with a short background. Beside the benefit of providing a Free Open Source Content Management System that saves you boring static HTML page editing, Drupal is a great, active community which constantly develops and maintains Drupal on the cutting-edge. You might have come across some Drupal sites before without knowing it. "Big Companies" already use Drupal, such as Sony BMG Myplay, MTV UK, Ubuntu, Fastcompany, OSI, Amnesty International (which is a good example of Drupal's internationalization in Arabic, French and Spanish). Dries Buytaert, the founder of the Drupal project, maintains a list of Drupal sites on his blog.

The installation of Drupal was pretty quick. It took longer to create the database on Dreamhost than installing Drupal itself. Drupal ships with many features in its core and relies on external modules to extend its capabilities. This is to avoid bloating the system with useless feature, since every site is different and will require different components. More than 2000 modules are hosted on the Drupal.org repository, and are classified by categories. Most of the work when setting a Drupal site involves picking the modules you need, and install them. wget and tar zxvf are your friends if you can SSH your server, or else use FTP. Note that the modules you add should be placed in sites/all/modules. There is also apt-get style module for Drupal called Drush, which allows you to automatically download and install any module.

One of the first thing we looked at was the OpenID support. After setting up a few accounts with our openids, we moved on to the following aspects.

  • Each piece of content is called 'node' in Drupal jargon, just think of it as a page or web document in a general. Each node has a title, a body, an author, a created and modified date etc. Because all the pages on your site don't contain the same thing, Drupal allows you to create different node types (see the "Content types" section in "Content management"). Some pages are rather static as an about page (page), but others could be of type blog post (story), forum post, documentation (book page).
  • Enable Clean URLs to remove the ?q= of the URLs in "Site configuration" > "Clean URLs".
  • Install pathauto to hide the internal path of your pages such as node/45 and automatically generate nice URLs depending on patterns you define.
  • admin_menu adds a drop down menu to your site when you're logged in, so that you can access any administration page very quickly.
  • Global Redirect cool module for those who care about SEO. It makes sure every single page of your site is accessed through a unique URL, and 301 redirects to the unique URL if the page is accessed via an old or incorrect URL: great to avoid duplicated content, or if you want to change some URLs without breaking the backlinks to your site.
  • CCK adds to any content type (page, story, blog post) custom fields that you define: contributors picked from a list of users, related nodes, images, files, links and so forth.
  • Views is a user interface to build mashups of the data available on your site.
  • We didn't have time to look at Panels, but it's another module to keep an eye on.

I also briefly showed Dan the multi-site feature I had already setup on one of my servers, which allows you to run as many Drupal site as you want on the same code base. If you wonder about a wiki functionality in Drupal, have a look at: Oh wiki where art thou?

The next things to do that we didn't have time to cover are

  • setting up the Drupal cron
  • enable the page cache and the CSS aggregation in "Site configuration" > "Performance". These have been proven to speed up your site, especially for anonymous users.

The default theme on fresh Drupal install is garland. Theming is essential when you want your site to look different and unique. Start off by looking at the themes available on drupal.org, and find the one that looks similar to what you want. Many of them are XHTML tableless themes. Don't look at the colors/images, but rather focus on the structure of the layout itself. Download and extract the theme you like the best in /sites/all/themes, and rename the theme directory to something of your own imagination. For example if you start with the amadou theme, rename the amadou directory to mytheme. Then you can start hacking away and make it resemble to what you like. The file page.tpl.php is the general template. I'd recommend trying to do as much as possible via CSS in style.css, and resort to changing the HTML as little as you can. If you already have an HTML template from a previous site, you can look at page.tlp.php and adapt it. Zen and Bluebreeze are great themes to start from, as they are simple and easy to adapt. They are also XHTML tableless and will ensure your site runs on most of the browsers. The Dojo lesson 28: Theming like a pro explains these steps in details. Definitely worth it

Many good resources about Drupal are available all over internet: Drupal handbooks, Lullabot podcasts (audio and video), DrupalDojo lessons.

Comments

Thanks again for walking me through Drupal. It's such a feature rich environment that getting started can look quite daunting, even though (if you know the paths through) it's really simple. My next job I think is to get some basic CSS/style for the FOAF site fixed, so I can get 'feature parity' with the current broken site.

Oh btw, here is the list of modules I ended up with at the end of our installathon:

admin_menu-5.x-2.4.tar.gz og-5.x-6.0.tar.gz token-5.x-1.10.tar.gz
cck-5.x-1.6-1.tar.gz openid-5.x-1.1.tar.gz
globalredirect-5.x-1.2.tar.gz pathauto-5.x-2.1.tar.gz

haven't explored it all yet, ... hopefully this week :)

cheers again!

Add new comment