One of the things I've always liked about some other blogging platforms has been the way they style their calendars. I particularly like the way they apply a background image to any cell that has a date in it, but apply no background image to cells that are empty. I believe this makes the calendar more usable and more attractive. Sadly the smarty file that defines the html output of our calendar, 'plugin_calendar.tpl', doesn't include any code to determine whether a cell is empty or not empty.
In a previous article I explained how to style the calendar using Serendipity's standard css class names. My Andreas08 theme was the first of my own themes to incorporate these discoveries by highlighting the first column in the table and placing a border around today's date. I started experimenting with background colors in my default theme competition entry when I used the smarty 'cycle' function to add a gradient background to the rows in the calendar. Now we're going to add the extra functionality that allows Serendipity theme designers to style cells that aren't empty. Read More
