Want to get Lullabot article, videocast, and podcast announcements delivered right to your in-box?
Let us know your email address (we won't share it) and we'll let you know when anything exciting happens.
The Great Pretender: Making your data act like a field
These days, almost every major Drupal site is using CCK, the module that lets you add custom fields to any content type. Among other things, CCK lets administrators rearrange a node type's contents using a simple drag and drop interface. In the past, this only worked for fields that CCK itself managed. If you worked with a custom module that altered a node's content, it was up to you to manage its position in the node content.
Now, though, it's possible for any module to tie into CCK's field management page to control the positioning of custom content. The key is hook_content_extra_fields(), and in this article we'll show you how to use it.

Drupocalypse Now (or, dangerous integer handling in drupal_write_record)
A couple of weeks ago, Twitter started circulating news about the upcoming Twitpocalypse. The easy 'default' storage format numbers in many programming languages and databases is the 'signed integer.' It's usually capable of representing values from -2,147,483,647 to +2,147,483,647. As fate would have it, the number of Twitter messages in existence was nearing that limit, and any developers who'd built software that stored tweets would encounter errors unless they started using larger number formats to store Twitter IDs.
Drupal's Twitter module (which James Walker and I co-maintain) had that problem: it archived Twitter statuses in the database, and it saved the Twitter IDs as signed integers. We released an update several weeks ago that changed the database column to an "unsigned bigint," capable of holding numbers as high as 18,446,744,073,709,551,615. Disaster averted!
Not Quite
When the big day arrived and Twitter Status ID 2,147,483,647 was finally posted, we started getting sporadic bug reports from users despite the fix we'd put in place. Even Sony Music, one of Lullabot's Twitter-using clients, got reports from their artists. Chris Daughtry's tweets weren't updating on his web site, and social media starvation was starting to set in. Time for some debugging!
Announcing Our Latest Video: Advanced Theming for Drupal
We're proud to announce the fifth video in the Lullabot Learning Series. Advanced Theming for Drupal, which picks up where the Drupal Theming Basics video lets off.
Here's the description:
The Lullabot Learning Series continues with an in-depth look at the advanced features of Drupal's theming system. In this 2-hour video Nate Haug, Jeff Robbins, and James Walker explain how to completely control the HTML markup Drupal generates. You'll learn how to modify and add variables sent to Drupal's template files and how to use the Theme Developer Tool to simplify the task of working with and navigating Drupal's complex theme system.
The video includes a crash course through PHP, then dives into advanced theming concepts with practical examples such as: how to theme forms, how to cleanly expose information to the theme system, and how to empower your site administrators by making certain parts of the theme available to them for customization. Lastly, the team covers security best practices on shows how to best sanitize user-submitted data and prevent security exploits.
This video completely implements our freely available 960 Robots theme, and gives you the tools you need to make your Drupal site no longer look like a Drupal site.
You can read the full description on store.lullabot.com.
In the following free sample chapter from the video, Nate Haug gives an overview of the template.php file and sets the stage for the specific examples that are provided throughout the course of the video:
The download version of Advanced Theming for Drupal is available right now in our store. You can find out more information and see another sample video that gives an overview of everything that's covered.
5-Step Drupal Distributions
Distribution? Eh? What's That?
We all love Drupal because it can do anything from a simple personal blog, to a complex social networking site with all the trimmings, and more! Of course, there's a lot of work that goes into making a really polished Drupal site, not the least of which is lots and lots of configuration: deciding which modules to use, enabling them all (and all of their dependencies), setting up your basic CCK types and views, configuring all of the settings on your site just so, and sometimes adding bits of glue code to make it all flow smoothly.
In version 5, Drupal added Installation Profiles (sometimes also confusingly called distribution profiles) to its list of features. An installation profile is basically nothing more than a list of required modules and a variety of configuration code which gets performed during installation to give Drupal a bit more oomph out of the box.
A "distribution" of Drupal is one or more installation profiles included with Drupal itself and all of the required modules. Distributions can either be offered as a convenience to site builders by bundling together frequently used components, such as Acquia Drupal, or they can be used to offer a version of Drupal specifically targeted to a unique use case, such as Open Publish. Dries has some heavy things to think about for anyone interested in getting into the distribution business, so I'll pause for a moment while you go and read that link.
Back? Great! So you've decided you want to share your ultimate Drupal site for whatever reason, and you want to do it in the fastest way possible. Then this article is for you!
Drupal Theming: The Code Behind the Videos
One of the best ways that we've found to learn Drupal is to look at a finished site. Drupal's out-of-the-box experience doesn't really show its full potential. In our latest Drupal theming videos, we needed to build a complete website in order to provide content to "fill out" the theme being built. Once we finished that site, we thought that video viewers and others might like to be able get access and try it out for themselves. So we've done two things with the code:
- We've uploaded the code and database to http://960robots.lullabot.com to act as a demonstration of the 960 Robots theme the we built in the videos. This is more for people to look at the front end and HTML output. We've disabled commenting and account registrations in order to keep the site in tact.
- We've also bundled up all of the code (modules, core files, etc) along with the database dump and created a installation profile which you can download here and install just like you would install Drupal core.
- UPDATE: We've also made available the original HTML template files with associated javascript & images so that you can follow along with the Theming Basics video.
Is This The Long-Awaited Lullabot Drupal Distribution?
Announcing Our Latest Video: Theming Basics for Drupal
We're proud to announce the fourth video in the Lullabot Learning Series. Theming Basics for Drupal covers, as you might guess, all of the basics of Drupal theming. Here's the description:
The Lullabot Learning Series continues with a hands-on look at Drupal's theming system. In this 2 hour and 44 minute long in-depth video guide, Nate Haug, Jeff Robbins, and James Walker explain the steps for translating a web design into a Drupal theme. The video explains Drupal's design vernacular, concepts, and special needs. The team shows how to associate the proper CSS & Javascript files, add all of the necessary regions, and control the HTML output through page and node-specific templates. You'll learn about the best tools and strategies for controling the look and feel of your Drupal website. This video covers the basics of Drupal theming. Drupal's more complex theming topics are covered in the Advanced Theming video (to be released soon) which pairs with this video and finishes the complete implementation of the 960 Robots theme used in both videos.
Read the full description on store.lullabot.com.
In this free sample chapter from the video, Jeff Robbins demonstrates the Devel module's Theme Developer tool:
The download version of Theming Basics for Drupal costs $75 is available right now in our store.
Free Drupal CCK & Views Video Chapters
We've had many requests for sample videos from the Lullabot Learning Series. We decided to post an entire chapter from each video. We tried to pick a chapter that was full of useful information on its own and we placed them on both YouTube and Blip, so feel free to spread them around and embed them on your favorite web page.
Hope you enjoy these videos!
Learning CCK for Drupal
In Learning CCK, Jeff Eaton, Nate Haug, and James Walker show everything from CCK basics such as adding and displaying fields to more advanced topics such as CCK’s database storage mechanisms, field-level permissions, and how to theme CCK’s output. Each chapter of this video builds upon the last as the team builds and configures the content types for a university job board. This video pairs well with Learning Views, which continues this job board project through to completion.
Chapter 3: Adding a CCK field
Drupal Charting
I needed to find a way to create nice charts from Views data so that end users could adapt them to selected date ranges or categories, but I found that this is not as easy as it ought to be. It took quite a bit of time just to figure out what the options were, let alone decide which were the most promising solutions for my situation. Since this turned into such a time-consuming project, I've documented the steps I took and what I found to make things easier for anyone else looking for solutions like this.
I investigated several Drupal 6x modules to see which ones might be ready for prime time. Many of the modules have alpha releases or less and/or have dependencies on other modules that are alpha or beta (i.e. Views Charts (alpha) depends on SWF Object API (beta), several of the modules depend on the Charts module (alpha)). Several are brand new modules with no activity beyond the initial check in. Because of that, I used the latest development version of each module in my testing to be sure I had the latest code with all fixes applied.
The Buzzr Demo Video - Making Drupal Usable
A few weeks ago, I put together an April Fool's Day post about a bunch of usability work that Lullabot had been doing with Drupal. My favorite April 1 posts are usually heavily based in reality, and, as we've mentioned previously, Lullabot has, in fact, been doing a lot of work trying to create a streamlined version of Drupal.
We started our project about a year ago, working with Karen McGrane from Bond Art + Science heading up our user experience work and Ed Sussman coordinating all of the business aspects of the project. We spent about 8 months building a prototype and started fund raising a little over 4 months ago. Having done all of this work on spec, and since it's still in flux, we were hesitant to share it publicly during our ongoing V.C. meetings. But as we've been watching the great usability work that Mark Boulton and Leisa Reichelt have been doing for Drupal 7, we've found that they're struggling with a lot of same issues that we have, and even starting to solve them in the same ways.
So rather than playing it conservatively and keeping our work hidden, we've decided to unveil it to the world and contribute our thinking to the usability discussion. Our project, now called Buzzr, is still moving forward and there are many more features and ideas that we are working on. But I've made this video to highlight many of our usability ideas and show how they were implemented... no joke!
Enjoy.
Introduction to Calais
Calais? I get e-mail about that at least 12,238 times a day. Buzz off.
No, not Cialis, silly... Calais (pronounced cull-AY). It's a free (as in cost) natural language processing, rich semantic metadata, web service, uh... thingy. The video on the front page is jargon-tastic for those into that sort of thing. But to cut to the chase, it basically reads in text from your site and, based on the bazillions of others sites' text from other people using the service, it figures out some sensible tags for you automatically so your editors don't have to do it.
However, rather than just being a simple flat set of free tags, the tags are instead grouped into areas analogous to Drupal's taxonomy vocabularies which are associated with "Entities" (People, Companies, Cities, etc.), "Facts" (a person's Position or relationships between entities), and "Events" (Sporting, ManagementChange, etc.). The format passed back is in an open, semantic web-compatible format (Resource Description Framework or RDF) which then allows you to form intelligent relationships between articles based on the subject matter. This can be used for things like assisting with SEO, getting better search results, creating an "Other articles like this" block, pulling in external data from other sources that speak RDF, or whatever else you can imagine doing with this kind of information.
How does it work?
To get an idea of how it works, chuck some text at http://viewer.opencalais.com/. For example, here's a Wikinews teaser about President Obama:
It correctly identifies the topic of the article as "Politics," "Washington,United States" as a "City" that the article is about, "Barack Obama" and "George W. Bush" as "Person" entities, and even finds a quotation by George W. Bush (though sadly, not as entertaining as some). Pretty nifty!
So, wanna wire this up with Drupal? Let's find out how!




RSS Feed


