It's the little details that make the difference in a clunky design and one that communicates with brevity and elegance. One thing that I've always hated in my Drupal blog is the wordiness of my author/date/comment line. You know what I'm talking about. In node.tpl.php it's the stuff you get when you print out $links.
Well, I resolved to make things cleaner in the next blog theme I work on, so that I can get displays more like this:
By jibbajabba on 21 Feb | 1 comment
Rather than this:
February 21, 2007 - 10:06am
jibbajabba's blog | 1 comment
I know it seems like such a minor thing, but it's little things like wanting to change that, but being too lazy to go figure out how to do it that keep me using the default display in my themes. Well, no more. On the bike blog (Love & Sprockets) I'm going to do it this way:
By <?php print $name; ?> on <?php print format_date($node->created, 'custom', 'd M'); ?> |
<?php
print $comment_count . ' comment';
if ($comment_count != 1) { print 's'; }
?>Or using the format_plural function, which chx pointed out:
By <?php print $name; ?> on <?php print format_date($node->created, 'custom', 'd M'); ?> |
<?php print format_plural($comment_count, '1 comment', '@count comments'); ?>Ahhh. I feel better now.