Read more link in Blogger (blogspot split posts)

The following tutorial will help you add a Read more link to the full post on Blogger/Blogspot.com

Step 1

Download and save your template so that you can go back anytime

Step 2

Select the checkbox named "Expand Widget Templates", which is right above the template code, to expand it into more code. Find the following tag:

</head>

and add all the green code before it:

<b:if cond='data:blog.pageType != "item"'>
<script type="text/javascript">

var fade = false;
function showFull(id) {
var post = document.getElementById(id);
var spans = post.getElementsByTagName('span');
for (var i = 0; i &lt; spans.length; i++) {
if (spans[i].id == "fullpost") {
if (fade) {
spans[i].style.background = peekaboo_bgcolor;
Effect.Appear(spans[i]);
} else spans[i].style.display = 'inline';
}
if (spans[i].id == "showlink")
spans[i].style.display = 'none';
if (spans[i].id == "hidelink")
spans[i].style.display = 'inline';
}
}

function hideFull(id) {
var post = document.getElementById(id);
var spans = post.getElementsByTagName('span');
for (var i = 0; i &lt; spans.length; i++) {
if (spans[i].id == "fullpost") {
if (fade) {
spans[i].style.background = peekaboo_bgcolor;
Effect.Fade(spans[i]);
} else spans[i].style.display = 'none';
}
if (spans[i].id == "showlink")
spans[i].style.display = 'inline';
if (spans[i].id == "hidelink")
spans[i].style.display = 'none';
}
post.scrollIntoView(true);
}

function checkFull(id) {
var post = document.getElementById(id);
var spans = post.getElementsByTagName('span');
var found = 0;
for (var i = 0; i &lt; spans.length; i++) {
if (spans[i].id == "fullpost") {
spans[i].style.display = 'none';
found = 1;
}
if ((spans[i].id == "showlink") &amp;&amp; (found == 0))
spans[i].style.display = 'none';
}
}

</script>
</b:if>

Step 3

Find the includable called 'post' and copy/paste the changes highlighted in red in below. Note that the word "uncustomized-post-template" may not appear in your template, but that's fine. To find the includable, you could search for the term id='post'. If you are not able to find it, you may not have expanded the template. Select the checkbox named "Expand Widget Templates", which is right above the template code, to expand it into more code.

<b:includable id='post' var='post'>
<div class='post uncustomized-post-template' expr:id='"post-" + data:post.id'>
<a expr:name='data:post.id'/>
<b:if cond='data:post.title'>
<h3 class='post-title'>
<b:if cond='data:post.url'>
<a expr:href='data:post.url'><data:post.title/></a>
<b:else/>
<data:post.title/>
</b:if>
</h3>
</b:if>

<div class='post-header-line-1'/>

<div class='post-body'>

<b:if cond='data:blog.pageType == "item"'>

<p><data:post.body/></p>

<b:else/>
<style>#fullpost {display:none;}</style>
<p><data:post.body/></p>
<span id='showlink'>
<p><a href='javascript:void(0);' expr:onclick='"javascript:showFull(\"post-" + data:post.id + "\");"'>Read More...</a></p>
</span>
<span id='hidelink' style='display:none'>
<p><a href='javascript:void(0);' expr:onclick='"javascript:hideFull(\"post-" + data:post.id + "\");"'>Summary only...</a></p>
</span>
<script type='text/javascript'>
checkFull("post-" + "<data:post.id/>");
</script>
</b:if>

<div style='clear: both;'/> <!-- clear for photos floats -->
</div>

Step 4

When you type your post, where you want the post summary to end, add the blue code:

<span id="fullpost">

and then type in the rest of your post. At the end of the post, just add the last line of tag:

</span>

Step 5

Your splitted posts should look like:

This is part one of my post
<span id="fullpost">
This is part two.
</span>

Notes

If you want a different text for the Read More or Summary only links, just change that to whatever suits you.

Example: Read More... changes to Continue reading...

Example: Summary only... changes to Close

You're done :)

4 comentarii

7 Dec 2009 la 22:08
Codruta

Mersi mult, am reusit

26 Feb 2010 la 12:12
crux

Mie imi da Read more in partea de sus a paginii. As vrea sa apara ambele jos, unde e rupta pagina

27 Feb 2010 la 04:47
pinkISH

nu cred ca inteleg exact. eu am aplicat exact pasii de mai sus si a fost ok. lasa-mi un link sa incerc sa ma dumiresc.

17 Jun 2010 la 00:32
Praveen

I believe this is the best and efficient way of doing this than any other way. Check it out:

http://praveenbattula.blogspot.com/2010/06/read-more-link-to-blogger-posts-without.html

Linkuri