How to Show Blogger Table of Contents by Label Name

One of our readers, goh left this question on the Beautiful Blogger Table of Contents tutorial:

Wonder is this possible. Let’s say if a blog post has 5 labels. Is it possible to create a TOC for each label and therefore have 5 TOC (one for each label) and in separate pages in blogspot?

I noticed that goh left a similar question on Techniqueal’s post, table of contents- label sort tweak which linked to the TOC tutorial. Unfortunately Techniqueal’s blog has been dormant since Dec, 2008 — a real loss. Her tweak is about presenting the full TOC list, but sorted by label.

So, let’s answer goh‘s query: YES!

The TOC works off the blog’s RSS feed, plain and simple. It then sorts alphabetically and presents the list. If you need only certain labels then we can change the feed to specify a label instead of all.

Rather than bury the solution in comments, here are the steps:

  1. Decide which labels you want and write down the exact spelling. Anything with a blank needs to be specified with %20.  e.g “Blog Design” is “Blog%20Design” when we code the TOC.
  2. Follow step 1 of the TOC tutorial to create styling (colors, etc) used by each page of TOC you’ll create.
  3. Follow step 2 of the tutorial and create a separate page(post with a very early date) for each label you intend to use in this way. Initially it shows all posts. Do this to verify you’ve implemented the steps correctly.
  4. Change the feed in the TOC post code to show only your label. Find this code:

    <script src=”http://bpwebnews.blogspot.com/feeds/posts/default?alt=json-in-script&max-results=999&callback=loadtoc”></script>

    *** remember you’ve changed the bpwebnews to your blog’s url!

    Replace the word in green only with

    default/-/labelname

    e.g. default/-/Blog%20Design

  5. Publish the post. Repeat step 4 above for each page of labels.

I hope others can use this information. And goh, let us know how it turns out!

image credit:by Ivan Walsh

If you found this post useful, leave a comment to let me know. Grab the BPWebnews tips button and share the luv with others. Get future posts in your RSS feed or by email.


If you found this post useful, leave a comment and share your thoughts with others.
Get future posts in your RSS feed or by email.


10 Comments

  1. Wow SBA! Thanks a million for your quick response. I am impress.

    Will try it over the weekend on my blog and will share the results here.

  2. Hi SBA. Sorry for my late response. Had been busy with "life". Haha.

    Yup! It works like a song. My blog address http://oldieslovesongs.blogspot.com
    Go to Archive. Look for Language and click "English". The TOC is there.

    Is it possible to tweak the code further to display only certain labels under the Labels column? For example, to remove the label "English" but display the rest.

    Once again, thanks for your help. Appreciated it.

    Recent blog:=- English Love Songs

  3. Very Fancy! I like your template and the content is well organized. You should find some 'buddies' in your niche and support each other to help build traffic. Thanks for following me on Twitter — you may also find like-minded music lovers there.

    As for your question- You can't remove the label 'English' since the widget just uses all labels you've added to each post. But it looks fine to leave it there…

    You should consider building a button image for your site (animated?) and create a scroll box like the one in my sidebar to have people grab it. The code puts your button and link to your site in their sidebar… See my posthttp://bpwebnews.blogspot.com/2009/07/someone-grabbed-my-tips-button.html for details

    Recent blog:=- How to Show Blogger Table of Contents by Label Name

  4. Thanks for your pleasant comment and tips. Will work on it and I will return …….for more tips and guides. Your blog is very helpful.

    Thanks for placing advertisement on my blog as well.

    Recent blog:=- Archives

  5. Great to have such a determined reader. Contact me on BlogCatalog anytime. Oh, that was quite a surprise to see my tips button in your blog footer — much appreciated.

  6. Hi,,i want to show my recent posts in table,with different label as a column,for example:- date,title,experience,location,Apply ..can u help me plz??

Comments are closed.