Archive for December, 2008

2009: Waiting to Exhale

Monday, December 29th, 2008

Lots of blogs list a bunch of stuff that happened in the year just past, and I have done a year-in-review post before, but in looking back at posts on this blog and elsewhere, what strikes me most is not the big achievements that took place in technology in 2008, but rather the questions that remain unanswered. So much got started in 2008 — I’m really excited to see what happens with it all in 2009!

Cloud Computing

Technically, the various utility or ‘cloud’ computing initiatives started prior to 2008, but in my observation, they gained more traction in 2008 than at any other time. At the beginning of 2008, I was using Amazon’s S3, and testing to expand into more wide use of EC2 during my time as Technology Director for (pre-buyout). I was also investigating tons of other technologies that take different approaches to the higher-level problem these things all try to solve: owning, and housing (and cooling… and powering…) equipment. Professionally, I’ve used or tested heavily AppLogic, GoGrid, and all of the Amazon services. Personally, I’ve also tried Google App Engine.

2008 was a banner year for getting people to start tinkering with these technologies, and we’ve seen the launch of ‘helper’ services like RightScale, which puts a very pretty (and quite powerful) face on the Amazon services. The question now is whether the cost-benefit analyses, and the security and availability story is going to be compeling enough to lure in more and bigger users. I think 2009 is going to be the year that makes or breaks some of these initiatives.

The other question I have about cloud computing, which I’ve been asking since the last half of 2007, is “where does all of this leave the sysadmin?” It seems to me that a great many of the services being trotted out for users to play with seek to provide either user-level GUI interfaces, or low-level developer-centric interfaces to solve problems that historically have been the purview of system administrators. I’ve been wondering if it will force sysadmins to become more dev-centric, developers to become more system-savvy, if it will force more interaction between the two camps, or if it means death to sysadmins on some level, to some degree, or for some purposes.

I really think there’s a lot of hype surrounding the services, but I also think there’s enough good work being done here that 2009 could begin to reveal a sea change in how services are delivered and deployed on the web.


If you’re working in the web 2.0, uber-scaling space, and you’re using MySQL, chances are your relationship with your database is less ideal than it was when you were using it to run your blog or your recipe database. As you try to scale MySQL through various means, you find that there are lots of things that could be handled better to make MySQL scale more gracefully. Some extra internal accounting and instrumentation would also be nice. In many cases, it would also be nice to just cut out all of the crap you know you’re not going to use. If you’re looking to sharding, it would be good if there was a database that was born after the notion of sharding became widely understood.

Drizzle is a project started by some MySQL gurus to take a great experimental leap toward what could become a beacon in the dark sea of high scalability. At the very least, it will serve as a foundation for future work in creating databases that are more flexible, more manageable, and, more easily scaled. Of course, it’s also likely that Drizzle will be tied more closely to a slightly narrower audience, but I can say from experience that had the ideals of the Drizzle team been fully realized in an open source product prior to 2008, I may not have even installed MySQL in the first place. I had at least a passing familiarity with what I was getting myself into, and pulled the trigger to use MySQL based on criteria that deviated somewhat from pure technological merit. 😉

I don’t believe Drizzle has announced any kind of timeline for releases. I wouldn’t expect them to. Instead, the first release will probably be announced on blogs in various places with links to downloads or something. The Cirrus Milestone for the project seems to focus quite a bit on cleanup, standardization, and things that, to prospective deployers, are relatively uninteresting. But I think 2009 will at least see Drizzle getting to the point where it can support more developers, and make more progress, more quickly. In 2009, I think we’ll see people doing testing with Drizzle with more serious goals in mind than just tinkering, and I think in 2010 we’ll see production employments. Call me crazy – it’s my prediction.


Windows market share on the desktop, it was recently reported by IDC, has dropped below 90% for the first time in something like 15 years, to 89.6%. Mac users now represent 9.1% of the market, and the rest is owned by Linux, at a paltry 0.9%.

It would seem that OS X has eaten away a few percentage points from Windows, and done perhaps more damage to the Linux space. I have no data to back that up at the moment – I’m going by the enormous shift from Linux to OS X between OSCON 2006 and OSCON 2008. I’ll let you know what I see at LISA 2009, which I plan to attend.

But what about Microsoft? Sure, they’re the company IT wonks love to hate, but the question of how their apparent (marketed) direction will affect their products and business is one that truly fascinates me. Microsoft has become the Herbert Hoover of American software companies, while Apple is FDR, perceived as having saved many of us from the utter depression and despair of the Hoover years (insert joke about sucking here).

Microsoft is enormous. It moves horribly slowly. It has shown a stubborness in the past that would seem difficult for something so large to shake off. Their products reflect this big, slow, obstinacy. What end users need is a software company that is going to lead its users in the direction they’re all moving in already on their own. It can no longer be about “allowing users” to do things (Ballmer has used such phrasing in the past). It needs to be about enabling and empowering, and getting the hell out of the user’s way.

The big question I think 2009 will answer is whether or not Ray Ozzie can affect change to either the culture, or the mechanics of how Microsoft does business (either one is likely to have a drastic effect on the other).

Python 3.0

It’s here already. I, for one, am quite excited about it. I think that GvR, Alex Martelli, Steve Holden, and others have put forth a very admirable effort to communicate with users and developers about what changes are imminent, what they mean, and how to prepare to move forward. I think 2009 is going to require 100% of the communication effort expended in 2008 in order to continue to rally the troops. I don’t know, but would imagine that the powers that be can see that as well, and so it will be. Assuming I’m right there, adoption will increase in the community, and the community buzz resulting from the wider adoption will begin to take some of the pressure off of the really big names, who quite honestly have craploads of other things to work on!

I believe that by summer 2009 we’ll see Python 2.6 migrations happening more rapidly, and a year out from that point we’ll start to see the wave of 3.0 migrations building to more tsunami-like proportions.

Another question: is there sufficien new adoption of Python going on to register 3.0 on the usage scale? Probably not now, but hopefully in 2009…

USA Gets a CTO

I’ve read a few articles about this, but all I’ve read really just amounts to noise and speculation. What, exactly, will the CTO be charged with? I’ve seen Ed Felten floated as a candidate for the position, but he’s not a person who’s going to want to run in and try to herd cats to try to standardize their desktop computing platform. I think if the CTO position is going to take charge of the things Felten has already shown a keen interest in (namely, high-level IT policy, the effect of technology on society, privacy and security… as it relates to the former two items, etc), then there could be nobody better for the job. Princeton’s Center for Information Technology Policy is one of the few places (maybe the only place) I’d actually take a pay cut to join ;-P

I imagine that 2009 will answer the questions surrounding the nation’s very first CTO.

It’s The Economy!

I’m a freelance technology consultant and trainer. Anyone who is making a living freelancing is probably wondering about the state of the economy, no matter where they live (incidentally, I live in the US). The numbers aren’t good. The S&P is down something like 41% this year – the largest drop on record. The state of the markets in general, along with the failing of the banks and their subsequent appearance in Senate committee hearings, as well as the deflationary spiral in the housing market (and predicted more general deflationary spiral) invoke images of bread lines and soup kitchens… or at least very little work for freelancers.

Personally, I have a lot to lose if things *really* go south to the degree that they did in the 1930’s, but I have to say that I don’t think it’ll happen. If you’re worried about this becoming the next Great Depression and are really losing sleep over it, I recommend you read a book called “The Great Depression” by Robert S. McElvaine. There are probably tons of books you can read, but this is one I happen to like. It’s full of both fact and opinion, but the opinions are well-reasoned, and loudly advertised as being opinions (you’re not likely to find a book about any topic relating to economics that isn’t full of opinions anyway).

What I think you’ll find is that, while there are a lot of parallels between now and then, there are lots of things that *aren’t* parallel as well (partly as a result of the depression – for example, the US is no longer on the gold standard, and both banks and securities trading are infinitely more regulated now). Also, not all of the parallels are bad. For example, things began to improve (though slightly at first) almost the day a new Democratic leader replaced the outgoing Republican regime.

My advice (which I hope I can follow myself): If the market numbers bother you, don’t look. Service your customers, don’t burn any bridges, rebuild the ones you can, build new ones where you can, and above all, Do Good Work. When you don’t have work, market, volunteer, and build your network and friendships. Don’t eat lunch alone, as they say.

What are you wondering about?

My list is necessarily one-sided. A person can be into only so many things at once. What kinds of tech-related questions are you searching for answers on as we enter the new year?

Holiday Project: Plot Google Calendar Events on Google Map

Tuesday, December 23rd, 2008

[UPDATE: 2009/08/08]: I’ve now gotten stuck on two separate projects, trying to find a bridge between Python code that generates data, and javascript code that is apparently required in order to present it. I haven’t found such a bridge. For one project, I was able to do what I needed with ReportLab (there was no webification requirement). For this project, it’s pretty useless if it’s not on the web, imho. So until I either break down and decide to deal with the monstrosity that *is* javascript, or someone else takes this code and runs with it, here it sits. There is only a slight chance I’ll decide Javascript is something I want to deal with. I’ve written some code in javascript. I’ve never enjoyed it, and I’m not very good at it.

While putting together the US Technical Conferences calendar over the past week or two, I noticed that the location of probably 80% of them (I’m guessing – it’s probably higher) is somewhere in California. I’ve always noticed that there is this trend to hold technical conferences in California, because there’s an enormous concentration of technology workers there. But c’mon! How about an OSCON East or something?

Anyway, I have more going on this holiday season than usual, but I always try to spend some of the downtime doing something interesting, and the Google Maps API is probably one of the few Google APIs I’ve never used. What better way to expose the inequity in conference locales than to plot all of my Tech Conference calendar events on a Google Map? Oh, and it’d be useful for people to be able to visually see where conferences are, and maybe color-code the markers according to Q1 2009, Q2 2009, etc.

I’ll be doing this in Python, by the way, though I’m pretty sure I’ve decided to go ahead and use javascript for the Maps portion. There *is* a Python utility that attempts to relieve you of the hellhound that is javascript, but it’s not documented at all that I’ve seen, and wrappers that attempt to generate javascript tend to be flaky (including one I wrote myself – I’m not picking here). I’m also using geopy for the geocoding, because it provides more flexibility than hard-coding calls against the Google Maps API.

By the way, this isn’t like some new fantastic idea I had. Someone else came up with a solution that works quite some time ago, but it involved several steps including Yahoo pipes and stuff. I really just wanted a script that, called with a parameter or two, would dump the appropriate .html file into a directory, or better, would just be called directly from the browser and take input (baby steps). Later, there are aspirations of plugging it into Django, an area where Google Maps has already seen some integration work, and another victim of my recent exploration/experimentation.

So, I already have some prototype code that might be useful for others who are maybe just starting out with the Calendar API. This bit of code will create an authenticated CalendarService object and dump the title and location of events on a calendar of your choosing. The assumption here is that the location is in some form that is parseable by whatever geocoding service you decide to use. For me (for now), I’m just using city and state locations – not addresses. Here goes:

#!/usr/bin/env python

  from xml.etree import ElementTree # for Python 2.5 users
except ImportError:
  from elementtree import ElementTree
import gdata.calendar.service
import gdata.service
import atom.service
import gdata.calendar
import getpass
import atom
import getopt
import sys
import string
import time
import geopy

calendar_service = gdata.calendar.service.CalendarService() = ''
calendar_service.password = getpass.getpass()
cal_id = 'id_from_calendar_settings_page_or_email_for_your_default_cal'
feed = calendar_service.GetCalendarEventFeed('/calendar/feeds/'+cal_id+'/private/full')
geo = geopy.geocoders.Google('your_google_api_key')

print feed.title.text  # the name of the calendar we're sucking feeds out of.
for event in feed.entry:
  print event.title.text, event.where[0].value_string # The event name, and location.
  (lat,lon) = geo.geocode(event.where[0].value_string)
  print lat,lon

It’s a start. Next I need to figure out the steps between this stage and making the actual cool stuff happen. Hopefully I’ll be back with an update right around the new year.

What do you find lacking/awesome in tech training classes?

Friday, December 19th, 2008

Dear lazyweb, 

Over the past year, I’ve spoken to a few clients about performing on-site training for their staff in things like Linux administration, SQL, PHP, etc. I’ve also gotten a few training contracts as a result, and those contracts have gone quite well, and I have some repeat business already! I really really enjoy that line of work (and my consulting work keeps my skillset sharp and insures I won’t get ‘stale’). 

What I think my current clients like is that they already know my work and are confident in my knowledge of the areas I’m training in, and they love that I’ll create custom content for them instead of having static, inflexible, prepackaged classes. 

Technical people, though, are extremely, excruciatingly scrutinizing, though. We’re a lot that likes to find problems with things, because we like to fix problems. We also (some of us, at least) believe that anything worth doing is worth doing right, and that’s my goal. So, although I’m also a part of that scrutinizing, problem-solving crowd, I’m also aware that I don’t have a monopoly on valuable opinions regarding how training is put together, delivered, etc. 

So, if you have had experiences, good or bad, with in-person training classes, or if something in one of those classes stood out to you, or something won’t leave your brain about your experience, I’d love to hear it!

What Ordinary Users Think About IE: Debunked

Wednesday, December 17th, 2008

Point all of your chain-mail-forwarding family and friends at this post. It’s a collection of things people have said to me, or that I’ve overheard, that reveal little tidbits about what people are thinking when they use IE.

I have to use IE – it’s my internet!

IE is not your internet. IE is what’s known as a web browser. There are lots of different web browsers. IE just happens to be the one that comes with Windows. It doesn’t make it a good browser or anything. It’s just there in the event that you have no other browser. If the only browser on your system is IE, the first thing you should do is use it to download Firefox by clicking here.

If IE is so horrible, how come everyone uses it?

They don’t, actually. There was a time not too long ago where over 90% of internet users used IE. However, with the constant flood of security issues (IE usage really should be considered dangerous at this point), IE’s horrible support of web standards (which makes it hard for web developers to create cool sites for you to use), and its inability to keep up with really cool features in modern browsers, its share of the internet usage market has been declining steadily over the last couple of years. In fact, this source puts IE usage at around 45% currently, so not even a majority of people use IE anymore, if statistics are to be believed. Accurate statistics for browser use are difficult to nail down, and are probably more useful to discern a trend, not hard numbers. Still, the usage trend for IE is moving downward, steadily, and not particularly slowly. If you’re still using IE, you’re almost a dinosaur. Just about the entire tech-savvy world has migrated over to Firefox, with small contingents choosing Safari (Mac only) and Chrome (Windows only). Very small camps also use Opera and Konqueror.

This is also not to be trusted, but it’s my opinion based on observation of the IT field over the past 10 years: of the 40% of people still using IE, probably half of them are forced to use it in their offices because they don’t have the proper permissions on their office computers to install anything else. The other half probably just don’t realize they have any choice in the matter. You do. There are other browsers. I’ve named a few in this post. Go get one, or three, of them.

Will all of the sites I use still work?

It has always been exceedingly rare that a web site actually *requires* IE in order to work properly. Your online banking, email, video, pictures, shopping, etc., will all still work. The only time you might need IE around is to use the Microsoft Update website. In all likelihood, you’ll be much happier with your internet experience using something like Firefox than you ever were with IE. Think about it this way: I’m a complete geek. I use the internet for things ordinary users didn’t even know you could do. I bank, shop, communicate, manage projects, calendars and email, registered and run my business completely online. It’s difficult to think of a task that can be done on the internet that I don’t use the internet for, and I haven’t used IE in probably 8 years, and have not had any issues. If you find a web site that absolutely, positively CANNOT be used UNLESS you’re viewing it with IE, please post it in the comments, and I’ll create a “hall of shame” page to list them all, along with alternative sites you can access WITHOUT IE, which probably provide a better service anyway 🙂

I’m not technical enough to install another browser.

Who told you that?! That’s silly. You installed Elf Bowling didn’t you? C’mon, I know you did. Or what about that crazy toolbar that’s now fuddling up your IE window? Or those icons blinking down near the clock that you forgot the purpose of. At some point, you have installed something on your computer, and it was, in all likelihood, harder to do than installing Firefox would be. It’s simple. You go here, click on the huge Firefox logo, and it presents you with super-duper easy instructions (with pictures!) and a download. It takes less than 3 minutes to install, and you DO NOT have to know what you’re doing in any way or be geeky in any way to install it. If you can tell whether you’re computer is turned on or not, you’re overqualified to be a professional Firefox installer.

I Like IE. I have no problems with IE.

Whether you realize it or not, you have problems with IE, believe me. I had a cousin who said he had no problems with IE too. Then he came to my house one day, knocked on my door, and when I opened it, he handed me a hard drive from his computer. He said that all of his pictures of his first-born child were on there, and his computer had contracted a virus, and he couldn’t even boot from the hard drive. So it was up to me to recover the only pics he had of his only son being born. True story. Turns out, I tracked down the virus on the hard drive, and it was contracted by IE. Also, it wasn’t the only virus he had. If you think you’re safe because you have antivirus software, you’re sadly mistaken. He had it installed too, but it hadn’t been updated in 6 months, so any viruses released since the last update weren’t recognized by the antivirus software, and were allowed to roam freely onto his hard drive.

There has never, in the history of browsers, been a worse track record with regards to security than IE. Never. I promise – but you’re free to Google around for yourself. Half of the reason antivirus software even exists is purely to protect IE users (though email viruses are a problem independent of what browser you use, admittedly).

The other reason you might say you like IE is because you’ve never used anything else. As an alternative, I strongly suggest giving Firefox a shot.

Why do you care what browser I use?

I’m a technology guy. I’m one of those people that would work with technology even if he wasn’t being paid. Some people care about cooking, or quilting, or stained glass, or candlemaking, or knitting, or sewing, or horticulture, or wine. Heck, my mom cares about every single one of those things! Me, I care about technology, and I care about the internet. I want the internet to be a better place. Browsers play a non-trivial role in making the internet a better place. Also, one reason I care about technology is that it helps people do things they might otherwise be unable to do. Browsers enable users to do great things, and it allows us developers to make great things available to you. But when countless hours are spent trying to make things work with IE, it just slows everything down, and you don’t get cool stuff on the internet nearly as fast as you could.

So, it’s less about me caring what browser you use. In fact, I don’t really care if you use Firefox or not, it just happens to be the best browser out there currently. If you want to try something completely different, I encourage that too. It’s more about me caring about technology, the internet, and your browsing experience.

Open Source Technology US Conference Calendar

Tuesday, December 16th, 2008

One of the best ways to keep up with your field and network at the same time is to attend conferences. It’s one of the things I look forward to every year. After learning that O’Reilly has decided to commit blasphemy and *not* hold OSCON in Portland, Oregon the same week as the Oregon Brewers Festival, I was inspired to look around at what other conferences I might attend in 2009. Turns out, this is a huge pain in the ass, because I can’t find a single, central place that lists all of the conferences I’m likely to be interested in.

So… I created a public Google Calendar. It’s called “US Technical Conferences”. It needs more conferences, but I’ve listed the interesting ones I found. In order to keep the calendar from getting overwhelmingly crowded, I’ve decided that conferences on the list should:

  • Deal with open source technology in some way. This is purposely broad.
  • Be at least 3 days in length

If you want something added to the calendar, I’d be delighted to know about more conferences, so leave a comment! If you want to subscribe to the calendar, it’s public – the xml feed is here, and ical is here.

How Are You Staffing Your Startup?

Monday, December 15th, 2008

I have, in the past, worked for startups of varying forms. I worked for a spinoff that ultimately failed but had the most awesome product I’ve ever seen (neural networks were involved, need I say more?), I helped a buddy very early on with his startup, which did great until angel investors crept in, destroyed his vision, and failed completely to understand the Long Tail vision my buddy was trying to achieve, and I worked for a web 2.0 startup which was pretty successful, and was subsequently purchased… by another startup!

Working in academia for 6 years also exposed me to people who are firing up businesses, or projects that accidentally become businesses, and some of those go nowhere, while others seem to be on the verge of NYSE listing now, while a year ago they were housed in the smallest office I’ve ever seen, using lawn furniture for their workstations.

Of course, I’ve also consulted for, and been interviewed by, a host of other startups – recently, even.

First, the bad news

The bad news is that most or all of these startups are headed by developers, and they have applied *only* dev-centric thinking to their startup. They’ve thought about how to solve all of the app-level issues, mapped out use cases, drawn up interfaces, hacked together prototypes, and done all kinds of app-level work. Then, they’ve hired more developers. Then more after that.

Some seem to have given almost zero consideration to the fact that their application might become successful, and its availability might become quite critical. They haven’t given much thought to things like backups or disaster recovery. They have no plan for how to deploy their application such that when it comes time to scale, it has some hope of doing so without large amounts of downtime, or huge retooling efforts.

They’ve also given very little thought to how to enable their workforce to communicate, access their applications and data remotely without huge security compromises, and generally provide the back end system services necessary to run a business effectively (though, admittedly, most startups don’t require much in the way of things like NFS, or even internally-hosted email in the very beginning).

In short, they’ve either assumed that systems folks’ jobs are so easy that it can be handled by the developers, or they think that scalability lives entirely in their code, or they’re just not thinking about system-level aspects of their application at all. And don’t even get me started about the databases I’ve seen.

I know of more than one startup, right now, months late in going live. None of them, at the time I spoke to them, had a systems person on staff, or a deployment plan that addressed things that a systems person would address. What they had was a lot of developers and a deadline. Epic fail.Yes, even if you use agile development methodologies.

The Good

The good news is that, while some companies hire no systems folks at all and flounder around system-related issues forever, others hire at least one or two good systems folks, and make them a part of a collaborative effort to solve systems problems in interesting ways, utilizing the knowledge and experience of both systems and development personnel to create truly unique solutions. When sysadmins and developers collaborate to solve these issues, I have learned that they can create things that will blow your mind (in a good way).

In fact, Tom Limoncelli wrote recently that systems administration needs more PhDs. Well, I suppose that would help, but I think we’d get really far, really fast, if we could just break down some of the walls between sysadmins and developers, give them a common goal, and let them hash it out. Sysadmins have an understanding of the system and network-related issues that developers aren’t likely to have. Developers, in most cases, can probably write better code, much more quickly, than a sysadmin. Developers and sysadmins working together, sharing their knowledge and communicating with each other, can solve systems problems in new, unique, creative, and very effective ways.

The End

In the end, issues facing startups now blur the line between development and system administration a bit more than in the past. There are problems that need solving for which there is no RPM or Deb package. These problems require some knowledge of how related or analogous problems have been solved in the past. A knowledge of the systems and development approaches that have worked, and why. Enough experience to have seen where and when things go bad, and why. It also requires creative and critical thinking. I think that good, senior systems and development people have these skills, and much more.

For whatever reason, it seems that the only time these two camps ever meet is on opposite sides of a deployment or application support problem. Perhaps this happens with enough frequency for people to think that the two camps can’t, or won’t, work together. They can, and they will. People with a love for technology will come together if the common goal involves furthering technology and its use, regardless of their background. Sure, it takes proper management like any other project, but it can be done.

If you’ve had experiences, good or bad, with dev/sysadmin collaboration, I’d love to hear your stories!

WordPress 2.7 – Ahhhhhh!

Thursday, December 11th, 2008

I guess WordPress doesn’t consider the changes they’ve made in 2.7 (released today) to be big enough to warrant a change to the major version number (which would make it 3.0). However, there are a few features now built-in that I’ve been dreaming about for so long that simply incrementing the second number seems to sell this version short. At least they named it after one of my favorite jazz musicians. This release is called “Coltrane”. Nice.

My top two feature requests: Check!

First and foremost, the number one thing on my list of desired features is now a reality: I can make bulk changes to the categories of my posts. So, when I add a category to WordPress, and then realize that lots of my old posts really belong there, I don’t have to go searching around and changing them by hand. I still might take a stab at doing back-end automation here, by scripting a tool that’ll search the content of all of my posts, and if the content has, say, 2 out of 3 terms in my search criteria, it’ll add the post to the category, using whatever database trickery is necessary. However, this solves almost all of my needs (save my need to hack things, sometimes for its own sake).

The other feature I’ve been wanting for a long time is also now a reality: replying to comments without having to go to the post page to do it. You can now moderate and reply to comments right in the dashboard.

This, for me, is huge. I’ve been waiting for these two particular features since about 2005.

More Baked-in Goodness

Some other niceties are now built-in that used to be addon modules in WordPress, which is great, because I’m always worried about third-party modules breaking and being abandoned as new WP releases come out. The nicest for me, as someone who maintains their own wp install, is the automated WP upgrade. Used to be an addon, now built in.

Another nice feature, if you *are* someone who doesn’t mind third party modules, is that now you can browse available modules, and install them, without leaving the wp interface.

Yes, another complete redesign

The admin interface has been completely overhauled, again. The last time they did this, a buddy and I discussed it, and although he felt one or two things were nicer, I felt that they had not addressed the biggest problems with the interface. Well, they fixed it by doing something I didn’t actually expect: they admitted defeat.

Instead of overhauling the interface, they’ve empowered the user to do it for themselves. Want the editor to fit the width of the browser window? No problem. Never use all of those features in the editing interface? Get rid of them. Only just noticed all those news items in the dashboard? Make them more prominent. You can do all of this by dragging and dropping things around, or collapsing them to ‘icon-only’ view.

I am writing this in 2.7, and in the editor interface, I definitely feel like more of what I need is readily available instead of buried somewhere in the countless blocks and sections and whatnot – which reminds me that there’s also a new (and quite nice) menu interface – also a part of the interface you can customize.

Check out the video and notes on the WordPress site. The tour video does a great job of giving a quick rundown of the new features I’ve mentioned here, and lots and lots of features I *didn’t* cover.

Hacking Drupal 6.x’s front page (or any other page)

Wednesday, December 10th, 2008

Drupal themeing is addictive. I’ve been so busy mucking with the new layout for one of my sites that I still haven’t gotten all of the content moved over, categorized, etc. I was really itching to fix “one last thing” on my site, and that was the front page.

My new layout uses the litejazz theme from RoopleThemes (though this tip should work with any theme, with only minor modification), which is super, super nice. It has three different color schemes, a million or so user regions to use, nice block formatting, lots of options and features… the works (thanks very much to the Roople folks for their work, btw).

Anyway, one thing I haven’t seen *any* themes do is provide an option to turn *off* the main content area on the home page (or any other page, for that matter). I wanted my home page to consist only of snapshots of various areas or aspects of the site, and the main navigation. I’m not doing some big news site or anything, so everything I’m doing fits into blocks. I don’t need the main content area. Turns out there’s a dead-simple way to get rid of it.

In your theme folder, whatever theme it is, there’s a file called page.tpl.php. Drupal (actually, PHPTemplate, Drupal’s theme engine) applies this page template to all of your site’s pages… unless it’s overriden!

Drupal’s theme system has a naming convention you can use to create page templates for any page or class of pages you want. So, if you want /node/8 to have a special look or feature that doesn’t exist anywhere else on the site, you can make a copy of page.tpl.php called page-node-8.tpl.php, alter the required parts, and /node/8, and only /node/8, will reflect those changes.

The same works for page-front.tpl.php, which is the home page of a drupal site. If you want to remove the main content, you can delete just that portion by removing lines that reference the $content variable. In the case of litejazz, I removed the entire ‘squeeze’ div, and now my footer touches the boxes in the top header area. Perfect!

Drupal 6.x Themeing Tips

Monday, December 8th, 2008

I’ve done some theme customization for Drupal, and I’ve used drupal as “just a user” for years. Recently, I took on a project to take a designer’s theme and make it work with Drupal. I’m pleased to say that, minus a couple of little quirks, it’s been relatively simple. Here are a couple of tips for those starting out:

  • Use CSS for the main layout. If you must use tables for some small part to get it just right, fine — but the high-level layout should be CSS. There are a million reasons for doing this that have nothing to do with drupal, but in addition, the way drupal manages the pieces that it manages (like menus and blocks created in the admin interface) encourages CSS use.
  • Don’t hard code anything that you don’t have to. Use the ‘base_path()’ and ‘path_to_theme()’ functions in page.tpl.php so that if you decide to base another theme off of this one by making a copy of the theme directory, it’ll ‘just work’, instead of having to go through and change every reference to every ‘img src’ in all of your files.
  • Get to know Drupal. You might be thinking you have a div that’s being hidden or isn’t showing up at all. In reality, it might be that you have a drupal block that your current login has no permissions to use, or a menu item that doesn’t apply to the current login, in which case it won’t show up in the menu listing. Also, you might have drupal’s caching enabled, which it shouldn’t be if you’re building a theme or doing development in general. To turn off caching, go to Admin->Site Configuration->Performance, disable caching, and then click on the ‘clear cache’ button.
  • Also under ‘get to know drupal’: depending on where your images are referenced, you need to use different paths. So, if your images are all in a directory under your theme dir called ‘images’, then images referenced in page.tpl.php need to be relative to the drupal top-level directory (so, ‘/sites/all/themes/<theme>/images/<imgfile>’). But in styles.css, you can use a directory relative to the styles.css file (so, ‘/images/<imgfile>’). I’m not 100% sure what the difference is, but presumably page.tpl.php gets ‘include’d into the main PHPTemplate theme engine code, which is somewhere else under the drupal top-level dir, which is why you need the full path. Correct me or clarify this in the comments if you know for sure.
  • Try to make time to learn about the Advanced Theme Creation Kit and/or Zen, which might make theme creation much simpler and faster. I did mine from scratch, and it’s ok, but if I had the time I’d rather learn to make use of these tools.
  • Pick up Drupal 6 Themes from Packt Publishing. It’s a great resource for learning this stuff, in spite of the absolutely awful code formatting in places, and some minor-but-annoying errors. Get it anyway. The conceptual parts of the text are fantastic, and the errors aren’t insurmountable. You can download a PDF eBook (with copy/paste enabled!) at the Packt website.
  • Use the CSS reference at w3schools.

Some general development practices can’t hurt either. Use some kind of version control for your theme, like SVN, CVS, Mercurial, Bazaar, git, or whatever. This will make it easy to revert to earlier copies of your work if you blow things up, and if you can host the SVN service somewhere that’s not on your development machine, it can also serve as a backup (though you should be backing up your machines anyway).

If you have other tips, leave a comment!