Demystifying Views API - A developer's guide to integrating with Views

Learning to use the Views module from the front end of Drupal is a daunting task, but you can rest assured that many others struggle along with you. There are many tutorials and screencasts dedicated the the subject. Tackling the Views API from the backend, however, is a bit more of a challenge. It's not easy to document the behemoth that is Views, and hence, the documentation is limited.

An unhappy combination: Drupal, Facebook, og:image, and https

Here's a bit of an esoteric issue that was a bit tricky to hunt down. I hope that this blog post helps the few people out there that it applies to!

You've got a secure (https) Drupal site, and you'd like it to contain facebook-compatible, open graph meta tags. So, you download the meta tags module and do some configuration magic. Everything looks good until you post a page on Facebook, and the image doesn't work!

OSX Lion Terminal: unknown terminal "xterm-256color"

Here's an annoying issue that I've run into a few times while using the terminal (or iTerm) on OSX Lion.

tput: unknown terminal "xterm-256color"
No entry for terminal type "xterm-256color";
using dumb terminal settings.

The issue derives from OSX Lion's terminal color settings, which is not always compatible with the settings on remote servers. There are a few ways to fix this issue.

Some options:

Migrate Classes: Content Profile to Profile2

This installment of the Migrate Classes series will give you a bit of sample code for migrating Content Profile nodes (D6) to Profile2 entities (D7).

Please note that this is not a tutorial for the Migrate module. If you'd like a detailed explanation of the Migrate API, please check either the examples in the Migrate module, or read this excellent blog post on the migrate module.

Building a Multistep Registration Form in Drupal 7

This article provides a step-by-step tutorial for creating a custom, multistep registration form via the Forms API in Drupal 7. For a Drupal 6 guide, I recommend Multistep registration form in Drupal 6.

Drupal 7's updated Form API makes the process of building multistep forms relatively painless. In combination with the excellent Examples for Developers module, it's really just a matter of copy, paste, and tweak.

Migrate Classes: Location CCK to Address Field

I've just begun to tackle migrating a site from Drupal 6 to Drupal 7 via V2 of the Migrate module. It's truly an excellent module, but like most things Drupal, it has a steep learning curve. To help offset that slope, I plan to post migration snippets on this blog throughout the next few weeks. The snippets should help to serve as starting points for the many different migration scenarios that you all may encounter. Here is a short list of tentatively planned examples:

Wrap first letter and first sentence in span via jQuery

For each target element, this script will wrap the first letter and the first sentence of the text. This is particularly useful if you need to style Drop Caps or a leading sentence.

$('.myclass p').each(function(){
// Split text at each period.
var text = $(this).text().split('.');
for( var i = 0; i < 1; i++ ) {
// Wrap first letter in span.
var first_letter = '' + text[i].substr(0,1) + '';
// Wrap sentence in span.