monthchunks for blogger

unfortunately this took me a long time to get around to. i got the following request in response to my monthchunks for wordpress post:

So is there any way that someone still on Blogger (waves hand in the air with earnest and pleading look on face) could wangle the original javascript to turn the ‘standard archive link into something a little more compact’? I assume this would be code that goes into my custom template in place of the month-by-month links I’ve got there now? Short of a real calendar, the less vertical space used up by my archive links list, the happier a camper I am. Many thanks, I hope! —Leeeny

i developed the monthchunks archive format originally in javascript to modify the display of the links to my blogger archive pages. but since i moved my blog over to wordpress and replaced the javascript with a plugin written in php, i thought the javascript was gone.

of course it completely skipped my mind that my neatlinks sidebar blog is blogger driven, and the monthchunks-style archive links at the bottom of the column are indeed generated by javascript on the client. here’s how to do it.

  1. get the javascript monthchunks-1.0.js into your blog in one of two ways:
    1. if you have the ability to upload files to your web host, grab the the monthchunks javascript above and upload it to your web directory (i put my javascript files in a folder called “scripts”), then add the following line of code before the </head> tag at the top of your current blogger template
      <script type="text/javascript" src="/scripts/monthchunks-1.0.js"></script>

      note: the src attribute assumes the script lives inside a folder called “scripts”—if this is not the case, change it appropriately

    2. if you cannot upload the javascript file to your web host (for instance if you’re using blogspot), add the following lines of code before the </head> tag at the top of your current blogger template
      <script type="text/javascript">
      // paste function here

      then left-click the “monthchunks” link above, copy the javascript, then paste it where it says // paste function here

  2. update your current template’s archive links output. it may look something like this:
      <a href='<$BlogArchiveURL$>'><$BlogArchiveName$></a>

    replace it with this:

    <script type="text/javascript">
    var archives = new Array();
    <BloggerArchives>archives[archives.length] = new Array('<$BlogArchiveURL$>', '<$BlogArchiveName$>');</BloggerArchives>
    <noscript><BloggerArchives><a href='<$BlogArchiveURL$>'><$BlogArchiveName$></a> </BloggerArchives></noscript>
  3. finally change your archive date settings in blogger (under settings > formatting > archive index date format to the mm/dd setting

and of course, if you run into any problems or have questions, please leave a comment. enjoy.

Feel free to if you found this useful.