In this Post, we are going to see how we can insert a working table of contents in blogger that too with a single shortcode. Blogger is a platform where there are lots of limitations compared to WordPress where a single plugin would do the job.
Now onwards you don’t have to depend upon long codes and javascript which would slow down your website. We present you the first shortcode based automatic table of content for blogger.
Features of Toc Plugin
We have designed this plugin especially for blogger such that no server load or third-party scripts are loaded besides the base jquery. And it only loads after your entire page is loaded so that other important content is loaded first and making sure our code doesn’t hurt them.
Complete Shortcode based
One time setup
Optimized Code for Performance
Toggle functionality
Minimal CSS
And the best thing is, It’s completely free and licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Benefits of TOC Pro
Table of Contents provide lots of benefits for a blog like it will help visitor to get an idea of your article. If your article is lengthy it would be a helpful thing for a reader to navigate between sections.
This can catch lazy readers to stay in your article and boost your CTR, this is not all the benefits there are lots of SEO benefits that we will discuss below.
SEO Benefits
There are lots of benefits in terms of SEO like Jump to links and one-line Sitelinks below articles. When you choose a template you would probably choose SEO optimized Blogger templates for your blog just like that TOC helps a lot in SEO.
Jump to Links in Google Search
Jump to links is very useful when you wrote a lengthy article and one of your sub-keywords is ranked on google. Jump to links would catch visitors quickly as it would match the searched keyword and take them directly to the portion of the particular article.
Jump Links
One-line Sitelinks
One-line sitelinks works like the ordinary sitelinks but the only difference is that it would be listing the contents in your TOC plugin. So whatever you wrote in your article would be highlighted below your post.
one line sitelink
Table of Contents in Blogger
You have to configure little things before using the shortcode. This is a onetime job and after that, don’t have to worry about it.
First of all, make sure that jQuery and Font Awesome Icons are already installed in your blog, it is usually present in most of the themes and if you are not sure about this just open your theme and search for jquery in the search bar and same for the font awesome icons.
How to Add Table of Contents in Blogger
Please follow the instructions carefully, and always make sure that you have kept a backup of your theme in case of any errors. This step is for non AMP versions.
1. From your blogger dashboard click Edit HTML in Theme panel and paste the below code after the </body> tag.
if you want to debug the errors or modify the script, this section would be very useful for you. Basically, our code search for an article tag which is usually present in most of the themes but I found some themes doesn’t have this tag.
All the head tags h1 to h5 are fetched inside the TOC block. After that, each heading tags are bundled inside the anchor tags where it is given a unique id which helps to identify the heading and its location.
This ID helps us to identify the section. Every heading will have an ID and anchor tags present with it, which will help it to locate the accurate positions. That’s how it works.
Post Body Elements
The below image gives you an idea of how blogger displays content dynamically in posts and pages. There may be two <data:post.body/> one for post and other for pages. If your theme doesn’t have an article tag then our plugin will not work.
To solve this issue simply put the <data:post.body/> inside an <article> tag which will fix our problem.
Debugging the Errors
All the codes are optimized and tested in various themes but can’t be the same in every case. If you find any problem with your theme you can comment below we will be happy to help you.
As described in the above case where the article tag isn’t present you can add an article tag as shown in the above section. If nothing is showing after clicking the TOC this is the most probable reason.
Templateify Theme Compatibility
Some users have reported that they are facing some issues while trying to install the TOC plugin, first of all, it’s not the problem of our code. TOC fetches all header tags from h1 to h5 in between <article> and </article> irrespective of content.
Some of the Widgets like the related articles, author section, and other widgets are grouped inside the <article> tag, this causes our code to fetch all the content. And fix is very simple change the tags which you don’t need to h6 or h7.
Fix for Templateify Themes
Change the <h3> and <h2> tag to <h6> and change the CSS accordingly
I hope that you liked this Post on how to add an automatic table of contents in the blogger and found helpful for your blog. If so please share this article with your friends who would also be benefitted. If you find any problem or issues you can Comment omment on Comments Box.
This plugin was created by Bloginos and all credits goes to the owner of bloginos.
My passion is technology and social networks, I research and document the latest news and tricks from Facebook, Twitter, Instagram and any social network so that you are aware of their latest developments. I know the digital world in depth and write the best detailed step-by-step guides for you to learn something new every day.
I was searching for TOC to implement on my blog site. Exactly did what you explained & its very nice.
Loading...
Comments are closed.
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
Cookie
Duration
Description
cookielawinfo-checkbox-analytics
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional
11 months
The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance
11 months
This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy
11 months
The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Easy and fast way of how to make table of contents in blogger.
I was searching for TOC to implement on my blog site. Exactly did what you explained & its very nice.