Beautiful Table of Contents(TOC) for Blogger
Table of contents is compulsory for blog that have large number of posts, so that users can find posts and navigate easily. Table of Contents is also Compulsory for Search engine optimized site.
It is easy to create Table of Contents page. Just follow these steps;
Setup Instructions:
- Login to Blogger
- Goto Pages
- Create a New Page (If you can’t create a new page. See How to Create Static Pages in Blogger)
Then Paste the code shown below;
<style type="text/css">
#toc{width:99%;
margin:5px auto;
border:1px solid #2D96DF;
-webkit-box-shadow:4px 4px 8px 2px rgba(0,0,0, 0.2);
-moz-box-shadow:4px 4px 8px 2px rgba(0,0,0, 0.2);
box-shadow:4px 4px 8px 2px rgba(0,0,0, 0.2);}
.labl{color:#FF5F00;
font-weight:bold;
margin:0 -5px;
padding:1px 0 2px 11px;
background:-moz-linear-gradient(right,#C2EAFE 0%,#055A85 40%);
background:-webkit-gradient(linear,left 10,right 80,color-stop(0.20,#055A85),color-stop(1,#C2EAFE));
border:1px solid #2D96DF;border-radius:4px;-moz-border-radius:4px;
-webkit-border-radius:4px;box-shadow:3px 3px 1px #bbb;
-moz-box-shadow:3px 3px 1px #bbb;-webkit-box-shadow:3px 3px 1px #bbb;display:block;}
.labl a{color:#fff;
}
.labl:first-letter{text-transform:uppercase;
}
.new{color:#FF5F00;
font-weight:bold;
font-style:italic;
}
.postname{font-weight:normal;
background:-moz-linear-gradient(right,#C2EAFE 0%,#fff 40%);
background:-webkit-gradient(linear,left 80,right 10,color-stop(0.60,#fff),color-stop(1,#C2EAFE));}
.postname li{border-bottom: #ddd 1px dotted;
margin-right:5px
}
</style>
<div id="toc"><script type="text/javascript" src="http://bloggerprofessionals.googlecode.com/files/MyTOC.js"></script>
<script src="http://www.bloggerprofessionals.com/feeds/posts/default?max-results=9999&alt=json-in-script&callback=loadtoc">
</script></div>
Change the RED Link with your own blog link and Save the Page.
That’s it. You are Done. For Demo You can See Table of Contents Page
This is just brilliant! Thank you. One question though. Can I have exactly the same Table but instead of sorting by Label could I do it by date. i.e a chronological table.
ReplyDeleteAlso, my blog has over 1800 posts. Will this table of contents show all of them?
This is so awesome. The color and design is great!
ReplyDeleteI have one question, how can I use this css and script, for a label based table of contents?
Hello admin.
ReplyDeleteThanks for your helping post. Nice solution code.
Best Regards,
ataur
Thanks, I have done. It very esaier
ReplyDeleteits awesome, thank you
ReplyDeleteThanks, it worked for me, i did not use the style. used only the script
ReplyDelete