After knowing about the Blogger's "standalone page" feature I wanted to add archive page for my blog. To start with I explored blogger gadgets, there is no way for adding the gadget to display only in one page and hide it in rest of the pages without editing the blogger template (I wish blogger will add this feature soon). Later I explored all the hacks on the internet but none seem to give the results what I wanted. After some trail and error I devised a method to add the archive page. I tried this hack and added an archive page for this blog and my photo-blog.
At a very high-level my approach is
- Add default blogger archive gadget.
- Edit the blogger template to hide the gadget using CSS.
- Create a page with javascript to parse the hidden archive gadget DOM and display the data in the required format.
More detailed steps below.
Advertisements:
Beginning Google Blogger ,Google Blogger For Dummies (For Dummies (Computer/Tech)),Blogger: Beyond the Basics: Customize and promote your blog with original templates, analytics, advertising, and SEO (From Technologies to Solutions),
At a very high-level my approach is
- Add default blogger archive gadget.
- Edit the blogger template to hide the gadget using CSS.
- Create a page with javascript to parse the hidden archive gadget DOM and display the data in the required format.
More detailed steps below.
- Log in to your blogger account select Design link of the blog which you want to modify
- Select Page Elements tab and click on Add a Gadget and select blogger-archive gadget
- Now configure the blog-archive gadget with below options
- style: choose
- Options: check
- Archive Frequency: choose monthly - After adding the archive gadget navigate to Edit HTML tab and take backup of your template by clicking Download Full Template. This backup will help you if you want to revert to old template.
- Click on Expand Full Template and add the following CSS snippet in the tab section of the template and the save it.
- Navigate to Posting -> Edit Pages -> NewPage in the page editor switch to Edit HTML modeand copy the following javascript and publish the page.
#BlogArchive1 { display:none; } |
<div id="myArch" style="float: left;"> <script type="text/javascript"> var archContent = document.getElementById("ArchiveList").innerHTML; var linkIdx=archContent.indexOf('post-count-link'); var pCL= archContent.slice(linkIdx); var year; var yrOrMon; do{ yrOrMon = /post-count-link.*?>(.*?)<\/a>/i.exec(pCL); // '; if (isNaN(yrOrMon[1])){ var sIndx = pCL.search(/<ul class="?posts"?>/i); var eIndx = pCL.indexOf('<\/ul>',sIndx); document.write('<b>'+yrOrMon[1]+' '+year+'<\/b><br \/>'); document.write(pCL.slice(sIndx, eIndx)+'<\/ul>'); }else{ year = yrOrMon[1]; } linkIdx=pCL.indexOf('post-count-link', 15); pCL= pCL.slice(linkIdx); } while( linkIdx > 0); </script></div> |
Advertisements:
Beginning Google Blogger ,Google Blogger For Dummies (For Dummies (Computer/Tech)),Blogger: Beyond the Basics: Customize and promote your blog with original templates, analytics, advertising, and SEO (From Technologies to Solutions),
6 comments:
Hi
Amazing hack, ive been waiting for this for years!
Everything worked well except my archive links only stretch back to september last year, the months prior are just listed below but arent clickable?
I'll check back to see if you replied!
Thanks
can you provide your blog url
Hello. very nice and informative post but i want to know about your blog.
Tanks You
Jump My Blog Ok
sos-hacker.blogspot.com
Tanks You SOB
Jump My Blog pleasee
sos-hacker.blogpot.com
Tanks SOB
Come to my Blog
sos-hacker.bogspot.com
Post a Comment