Currently showing posts tagged: blogging

Hacking Blogger templates

By , April 19, 2009 5:20 pm

The ultimate goal here was filtering of posts based on inclusion (or even better, exclusion) of posts with certain labels. (Read this post first for context.)

[Update: before you think about imitating the following approach, you should know that I gave up with Blogger and switched to WordPress which is far more flexible and easy to hack.]

Unfortunately it turns out that Blogger’s XML-based template layout system is not quite as flexible as it first seems. It’s almost superb, but has some key omissions:

  • Flow control is limited to <b:if>, <b:else>, and <b:loop>. Crucially, you can’t break out of a loop.
  • No writable variables of any kind.
  • Conditional testing via <b:cond> is extremely limited. I kept expecting to find some comprehensive documentation for the xmlns:expr namespace (which is used via things like <a expr:href='data:blog.homepageUrl + "search/label/foo"'>), but it doesn’t exist, simply because all you can really do is simple comparisons using a limited set of data and hardcoded strings.
  • There are no string-handling functions, and you can’t get access to the current QUERY_STRING to do any kind of parametrisation (for example, show some HTML saying which label you are currently viewing based on what comes after /search/label/ in the current URL).
  • The box generated by the status-message includable is hardcoded to either be invisible or say “Showing label foo. Show all posts”. It cannot be customised.

Continue reading 'Hacking Blogger templates'»


Two blogs or not two blogs?

By , April 19, 2009 2:20 pm

I lead double lives. Most of my friends and family know I do “computer stuff”, but have little clue what that actually involves. I want to be able to blog not only about music, triathlon etc. but also about (often deeply technical) computer stuff without causing normal people to run away screaming. So the question is, should I set up two separate blogs, or do it all in one but use some Google Blogger hackery with labels and templates to hide the geek stuff from the default view?

Continue reading 'Two blogs or not two blogs?'»


Panorama Theme by Themocracy