It takes more than a day to learn how to theme Drupal

As I mentioned below, I’ve been learning Drupal. My practice exercise is to build a blog! Surprise, surprise.

So, I’ve been porting this blog to Drupal. Getting Drupal to emit “hello, world” took less than an hour. Getting all the initial modules tweaked and exploring the nooks and crannies of the admin interface took another few hours, after which I had a blog just like this one, except with comments and an RSS feed and a working full-text search. I may even have tagging, if I decide that I want to turn it on. All that I’m missing is the content and the visual design.

Which turns out to be the hard part. It’s not immediately obvious how to move your old site’s content into Drupal, and even after I found the Node Import module and made it almost work… I found that some of my posts had been cut off during the transfer, for mysterious reasons. I’m still not sure if the bug is in the 5-minute Ruby script that I whipped up to convert my blog posts into a CSV file, or in the module itself. Meanwhile, woe betide you if you accidentally click the button which “cleans up” after your inserts: you will end up doing the insert twice.

And then there’s the visual design. I started on it this morning, and it turns out there’s a reason why Drupal themers are in such high demand: Drupal theming is hard! Even after I took the Lullabot team’s advice and started with the elegant Zen theme as my model, I found that HTML and CSS was arriving in the final document from mysterious locations deep in the source tree. Just getting the search box and the “Search” button to change places was an hour’s work, involving reading the (wrong) HTML and noting the CSS classes, getting a refresher course on the Drupal Form API from Pro Drupal Development (do not attempt Drupal coding without this book), grepping the Devel module’s list of Every Drupal Method Ever for the relevant page, grepping my entire Drupal source tree once or twice, and finally overriding theme_search_theme_form, which sounds like something Porky Pig might have written but which actually makes a strange kind of sense, now.

So don’t look for the new version of the blog before next week. :)

Comments

(not verified)
2 Nov 2008
5:47

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <pre>
  • Lines and paragraphs break automatically.

More information about formatting options