Easy Create Automatic Chapters List on Blogger - BLOGHINT

Easy Create Automatic Chapters List on Blogger

Encrypting your link and protect the link from viruses, malware, thief, etc! Made your link safe to visit.


Creating a chapter list on Blogger is easy but it takes a while to type manually, so the automatic chapter list that I took from the MegumiNovel template created by Codepelajar might be a solution.

This script automatically displays a list of links to posts with a specific label. Suppose the label is Hero, then all link posts and titles with the label Hero will appear in a list. To make it, you have to enter theme edit in html mode, and don't forget to backup the template first. If something untoward happens then you just have to restore it.

Let's go to the tutorial and I assume you have entered the html template edit mode, now look for the code
 <b:includable id='post' var='post'>
Now add the following code right above it
<b:includable id='select_chapter'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name != &quot;Novel&quot; and data:label.name != &quot;Anime&quot; and data:label.name != &quot;Manga&quot;'>
<script>
var postID = <data:post.id/>;
//<![CDATA[
if(autlist==true){function autolist(e){for(var t=0;t<e.feed.entry.length;t++){for(var r=0;r<e.feed.entry[t].link.length;r++)if("alternate"==e.feed.entry[t].link[r].rel){var n=e.feed.entry[t].link[r].href;break}var f=e.feed.entry[t].title.$t;e.feed.entry[t].id.$t.substr(51,19)!=postID&&document.write("<li><a href="+n+">"+f+"</a></li>")}}}
//]]>
</script>
<div class='auto-listchap'><ul><script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?orderby=published&amp;max-results=99999&amp;alt=json-in-script&amp;callback=autolist&quot;' type='text/javascript'/></ul></div></b:if></b:loop>
</b:includable>

For "Novel, Anime and Manga" is an exception label that will not be executed so the script does not add posts with that label. If you want to add an exception you add the code  and data:label.name != &quot;Label Name&quot;Then you just add the following code below the code<data:post.body/>
<b:if cond='data:view.isPost'>
<b:include name='select_chapter'/>
</b:if>
Now you save and open the post you want to add a chapter list to automatically, and enter the following code at the bottom of the post. 
<script>var autlist = true</script>

Please create your own style so that the automatic chapter list looks good, if you want the style I have used, please add the following code above the code  ]]></b:skin>or code </style>and of course you have to enter again into html mode.

.auto-listchap {
max-height: 244px;
overflow: auto;
}
.auto-listchap ul {
padding: 0.1rem;
margin: 0;
}
.auto-listchap li {
background-color: #eee;
padding: 0.3rem;
margin: 0.3rem;
}

Now look at the post, if the automatic chapter list script on blogger fails, please ask in the comments column, maybe I can help. And we should be grateful to Codepelajar who made this script.

0 Response to "Easy Create Automatic Chapters List on Blogger"

Post a comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel