Drupal!

[this post is probably a draft. might be adding links and such later.]

As of yesterday, my work site is running on Drupal. It’s been a long process, starting probably about a year and a half ago. Yesterday I was a little insane getting it live, but I’m really happy now.

When I started this job, the site was all static pages, no templates even, with a number of small home-grown PHP apps to post the rates, jobs, and a couple of other little things, plus phpAds to show promotions. Since then, I added templates, upgraded phpAds, reworked the home-grown apps, added a WordPress installation for news, and Kayako’s Support Suite for email and chat. It’s been good, but unwieldy. And honestly? I’m a jack of all trades, not a PHP programmer, so those apps have always been a little…fragile.

I’ve used WordPress for a long time (heck, I’m using it right now), so I did look at it as an option. But the site in its cobbled-together form was just too complex to recreate without a lot of insane hacking, which gets back to me being the programmer.

I’d also used Drupal before, in the 4.x version back at Pierce. My snap judgement was that it was incredibly powerful, and a PITA to set up and manage. Taking a whirl with 5.x improved my opinion of setup and management…vastly, and at the time, in the early days of 6.x, it looked like that was going to be another big step up. So I started futzing, initially with 5.x. The point was, basically, to recreate what was on the site already, but in a unified interface via Drupal.

It was right at that cusp of deciding whether to use D5 or D6: for a while I had a spreadsheet with the modules I thought I’d need, noting where they were on D6 conversion. (I now have a similar one with notes about D7.) Then I had an opportunity to do a small subsite that didn’t need as much functionality, and it was my first go-round with D6. And it was good. 🙂 It went live about this time last year; the site setup — and its maintenance since then — have been quite good, which gave me confidence to go ahead with D6…once the modules were ready.

That’s the thing about Drupal, even more so than WordPress: there’s a module to do damn near anything, but not all of them have the same level of attention or quality. Many depend on the scratching-your-own-itch phenomenon, and if the itch is small enough, and once you’ve taken care of it, there’s not much motivation to keep the thing alive.

So it wasn’t really until maybe this spring that enough of the pieces were in place that I could definitely go ahead. From there on, I was gradually puttering along recreating functionality and figuring out how Drupal works.

I have to give huge kudos to Apress and the Pro Drupal Development book. I ended up with a free PDF copy after SXSW, and that thing really got me going. I spent several afternoons at the nearby Starbucks with printed out chapters, scribbling in the margins and slapping in post-it notes. Chapter 8 on theming was particularly helpful, as was Chapter 12 on search. Eventually I’ve worked my way (mostly) past the cargo-cult-coding stage, those pieces helped me get there.

Getting the theme right was a big deal, and though I still feel like I haven’t done it to my own personal standards, I’m thrilled that I couldn’t tell the difference, visually, between the old site and the new. I used Zen as the base theme, and went nuts from there. There are some particulars that I decided to handle differently, but those were (mostly) conscious choices. I was even able to clean up some of my design work from last summer’s redesign, which is always nice.

The other things that helped tons with theming were the Devel and Contemplate modules, along with Firebug. Devel and Firebug helped me see what was being created…Firebug in particular was great for converting class and ID names in the CSS. Trying out templates with Contemplate helped me understand how to create my own template files for all the different node types, even content fields.

Which brings up CCK, I suppose. Another one of those amazing, powerful, and often crazy-making tools. The thing that took the longest of the whole project was creating our rate tables. People love ’em, but wow are they complicated, especially since the folks who do the entry like to be able to enter rates ahead of time to appear when they become effective. I discovered the (experimental!) multigroup feature…and for that feature, my needs were actually pretty simple. It took me a long time to figure out how to theme a multigroup; the day that happened was the occasion of much rejoicing. I’ll be interested to see how it evolves in CCK 3, for sure. In any case, I had to try many different versions of content types for the rates before settling on my current scheme. Of course, that involves Views as well, which I’m also pretty thrilled with overall, even if there are bits and pieces that remain entirely mysterious to me. (Relationships?! And I never did get multiple arguments working quite how I wanted.)

I kept discovering modules over the project, occasionally that led to tearing up one way of doing something and trying something entirely different, running into dead ends, etc. (Don’t ask about nodepicker for tinymce.) I think I’ve gotten a feel for deciding whether a module is going to be worth my time…a look at the issues queue is often very instructive.

Some highlights: Panels is way cool for some of the multiple-resource type pages, and had I tried it out sooner, I probably would’ve used it for the homepage. Actually, the article I’m writing for our email newsletter, about site enhancements, is going to be entirely about new features made possible by Panels. Clone Module is simple and does exactly what I needed it to. Insert Block and Insert View are incredibly valuable for drawing little chunks of content into other pages. ThemeKey makes me a little crazy (sometimes I swear my selections don’t take) but very useful for handling some particular admin-type, but not actually admin, pages (also helpful: Simple Access), as well as a subsite that has a radically different theme. I still feel like I don’t totally understand Organic Groups, but that subsite couldn’t happen without it. I’m figuring I’m going to learn a whole lot more over the next few months! GMap rocks the branch map, although I still really want a way to make the links on the list of branches open the associated bubbles. I could do that with my hand-built code, but not with the module. 🙁 Getting advanced processing working in Webforms was one of those fist-in-the-air moments, and it took me a reeeeeally long time to get there. I should probably write some more detail about how I made that work.

I even wrote my own module. 🙂 It’s based on one from Pro Drupal Development, and searches the knowledgebase that comes with our contact center site. (Coordinating those two pieces has been a challenge, and I’m still not really done. I’ll be futzing with that for probably several more weeks.) It started out pretty cargo-cult, and then I had one of those epiphanies, and it just all came together.

The whole Drupal experience was a little like that: having a vague idea of what I wanted to happen, searching out a bunch of different ways to do it, being horribly frustrated, then usually pretty suddenly, figuring it out and going gangbusters. There’s a lot of power there, and with great power, etc., etc. Also, try not to cut your hand off with that chainsaw.

Importing data is another piece I should probably write about in more detail. I ended up doing half a dozen different things, but most useful were Node Export,  Taxonomy Import/Export via XML, Node Import, and Backup and Migrate. The first two I used primarily in transferring data from the Drupal subsite into the new site, and the first is really nice for moving individual nodes. Node Import was the happy bulk tool, although I did have to copy/paste a lot of HTML from individual files into a spreadsheet: clunky, but for the basic info pages, it worked just fine. Backup and Migrate helped most in the transition from test to live, and I’m assuming it will continue to serve that function. I even had to revert the live version once during the install because I did something incredibly dumb, and the reversion went wonderfully well. 🙂 There’s also a module specifically for importing WordPress content that got all of our news posts in nice and easy. The name escapes me at the moment. I am frustrated, though, at how long it took me to figure out how to do all that. I found a page, eventually, listing a bunch of options, and that helped…but at the time, it didn’t list Node Export! So there you are.

Which reminds me: I did get helpful information on a number of topics via the Drupal community in Seattle. In particular, Greg Dunlap’s slides on data import and deployment gave me lots of good ideas, and Jennifer Hodgdon’s DrupalCamp presentation about Views helped me get my brain around that stuff. I’ve been able to go to a few Drupal events in Seattle now, and while I haven’t always been able to stay the whole time, they’ve been great opportunities.

Twitter’s been a source of advice, assistance, encouragement and sympathy as well. In addition to Greg (heyrocker): gregoryheller, lauras, joeeastham, mahalie, xtfer, and shelleypowers. (In book acknowledgement tradition, I’m sure I’m missing someone.) I continue to be amazed by the power of the internet for learning and sharing.

I wanted to pour all of this out there while it was still fairly fresh in my mind. A lot of time has passed already, and it helps for me to write about the experience of getting started. I know I’m not done either. There’s still plenty to learn, features and modules I want to try, and new projects for the site.

Oh, and as you might imagine, I’ll be at the Pacific Northwest Drupal Summit next month.

(As for this site? I’m sticking with WordPress. It’s just about perfect for the basic bloggy thing that I’ve been doing here for the last 8+ years, and I still enjoy using it. I’m still into it for basic sites, too: the Eastside Neighborhood Association, Christmas Tree Lane, Friends of the Olympia Library. There’s a jump in complexity from WordPress to Drupal that isn’t always necessary, or even a good idea. In the same way that I’m essentially agnostic in the Windows/Mac religious wars, I’m good with both systems, for their own purposes.)