Romka's Bits and Bites

complains, jokes, and recipes

Sunday, July 24, 2005

Blogger Calendar

Dear reader,

For more convenient navigating through my blog I created a calendar on the right side of the page just under a "Posts By Date" heading. If you don't see it or if you get an error loading the page, please let me know it in comments (be sure to say the name and the version of your browser).

For blogger users: this calendar is my blogger archive hack that uses JavaScript and blogger daily archives. If you want to have it on your own blog you have to follow these steps:

  1. Change "Archive Frequency" to "Daily" in your blog's settings (tab "Archiving")
  2. Change "Archive Index Date Format" to something like "December 22, 2005" on "Formatting" tab
  3. Insert the following lines into the template of your blog inside <head> tag:

<script language="JavaScript" src="http://romakas.balticom.lv/css/calendar.js"> </script>
<link href="http://romakas.balticom.lv/css/calendar.css" rel="stylesheet" type="text/css"/>

  1. Insert the following code inside <div id="sidebar"> tag:

<h2 class="sidebar-title">Posts By Date</h2>
<MainPage>
<div id="div-archive-calendar" style="width:200px;height:180px;"></div>
<script language="JavaScript">
<BloggerArchives>
vArcDates.push('<$BlogArchiveName$>');
vArcLinks.push('<$BlogArchiveURL$>');
</BloggerArchives>
drawCalendar();
</script>
</MainPage>
<ArchivePage>
<script language="JavaScript">
drawURLBack("<$BlogURL$>");
</script>
</ArchivePage>

There are several limitations of this hack due to specifics of blogger archive entries. That was the reason I have restricted blogger calendar to show only on the main page.

You can copy files calendar.js and calendar.css, just leave my name there in comments and a link to my blog.

P.S. The calendar works with old blogger templates, but I still didn't check new blogger templates.

P.P.S. If you want to change the size of the calendar, modify line <div id="div-archive-calendar" style="width:200px;height:180px;"></div>

If it doesn't work or you found any error, let me know. Regards, Romkas