Hacking The Blogger Matrix

The Blogger Matrix

By Graham Waldon

Personal expression isn't limited to writing or sharing pictures. Some of us like to exercise our creativity on a different level, taking things apart to see how they work, and finding new ways to put them back together again. We strive to create functionality and build more tools to further the limits of our personal expression. We seek an environment that will respond to our skills. Blogger is that place.

Dreaming up a post and clicking Publish does not come naturally to everyone. For some, the joy comes from digging into the nitty-gritty details. Blogger lends itself to creating hacks. Not evil, breach-of-security type hacks, of course, but hacks in the O'Reilly sense of "clever solutions to interesting problems." Hacks for the good guys.

Maybe you have an idea for a new feature you'd like to see. Maybe you just want a little more control over your blog's appearance or settings. Whatever the case may be, just put your creativity to work on it. Dive on in and find a way to make it happen.

I'm here to get you started. I've been doing this for a while now, living in the Blogger Matrix, structuring my own reality with template tags and blog settings. But now I want to invite you to join me. Take the red pill, Neo, and I'll show you how deep the rabbit hole goes.

General Tips

Before we begin, we'll need to cover some safety precautions. Most Blogger Hacks require template modifications, ranging from slight tweaks to complete overhauls. An experienced template ninja will always have a template backup on hand, stored safely in a text file on a hard drive. Thus, when a misplaced angle bracket suddenly causes a rift in the space-time continuum, the damage can be reversed instantly, with no lasting harm to either the blog in question or the continued survival of the human race.

In fact, if you are planning on doing anything highly experimental, you might even want to create a new blog entirely. This blog can be your development laboratory, and new hacks can be copied to your primary blog after they have been thoroughly tested and approved.

Finally, there's some background knowledge you might need, depending on the type of hacking you want to do. HTML forms the basic structure of all webpages so all hacks involve manipulating this to some degree. Knowing some CSS is also very handy for design work. And in extreme cases, you may even want some JavaScript. So prepare your tools.

See: How can I learn some basic HTML?
See: What can I do with CSS?
See: JavaScript Central
Now that we're all set to go, let's do some hacking!

Different Contexts for Data

If you look through some of our default templates, you may get the impression that you're limited in what you can do with Blogger template tags. <$BlogTitle$> always shows up with <h1> tags around it, <$BlogDateHeader$> is always stuck with <h2>. Is that all we can do? Of course not. The first trick to learn is that you can change functionality simply by putting familiar tags in new contexts.

For instance, most of our default templates display archive links in a list. But really, the archive tags simply provide the names and URLs of all the archive files, and we can do whatever we want with them. Do you know how to make a pull-down menu in HTML? Think that might be a more efficient format for your three years of daily archives? Great! Move the archive tags out of the list and into a menu.

See: How do I put my archive links in a menu?

Want something even trickier? Those archive tags don't even have to touch the HTML directly. Put them in some JavaScript variables and you can do even more with them.

See: How do I change the order of my archive links?

Different Kinds of Pages

Your blog only has one template, right? Wrong. A single template is only the façade that the Matrix wears to hide the trinity of main, archive and post page templates. Through the magic of conditional tags, these pages can all be manipulated independently.

See: What are conditional tags?

This allows for lots of flexibility. You can show summaries of your posts on your main pages, or have your archive pages only list the titles of your posts, knowing that the full text will be available on the post pages. Got another idea? Go for it!

See: How can I list my archives by title?
See: How can I create expandable post summaries?

Not Using Blogger Tags

As wonderful as Blogger's template tags are, there may be times when we prefer not to use them. This is infrequent, but it happens. A good example is the <$BlogItemCreate$> tag, that makes the "Post a Comment" links for your posts. This is a great tag if you want everything done for you without a fuss, but it doesn't yet allow for much customization. The text, for instance, is always in English, which would look silly on a blog that's in Portuguese, Icelandic, or Klingon.

Experienced hackers will not be limited by this. Rather, they will check the output of this tag in their published blogs and find a way to recreate it themselves, with modifications.

See: How can I change the "Post a Comment" text?

Your Mission

This is just the beginning. From here, you are free to carry on hacking and creating, pushing and expanding the limits of what Blogger can do. If you come up with something brilliant, send it to us and we can help you share it with the world.

Wake up, Neo. The Blogger Matrix has you.

Graham Waldon is the one. He works on Blogger at Google.
Phillip E. Pascuzzo is a designer and illustrator living in New York.

Published: Monday, June 28, 2004, 11:21