Custom Search
Ads by VADpay advertising

Google Adsense for Vietnames Headline Animator

Tuesday, September 2, 2008

How To Add The Blogger “Read More” Expandable Posts Link - One more method

Thanks for visiting my blog. Please leave your valuable comments for this post. If you would like to read my new posts via your email, please click on Subscribe to register. Thanks also for your rating. To know more information, please visit links below:

In the previous post, I have introduced a method to add "Read more" into our blog, and it works well. However, there are some inconveniences with this method:

First, for each posting we have to add the code <span class="fullpost"> and </span>. It is boring.

Moreover, for those whose have posted many articles without "Read more", you have to edit all posted articles to add
<span class="fullpost"> and </span> in your posts.

Following I shall introduce to bloggers a new method, it works automatically for all old and new posts. For Vietnameses, you can visit here to read in Vietnamese.

If you have ever used any methods for "Read more", please remove their code out of your html source.

Now we begin to add the code in our html source.

1. Go to Edit Html,
click to Download full template for safety.

2.
Choose Expand Widget Tempate.

3. Press F2 to looking for <data:post.body/> and replace it by the following code:


<b:if cond='data:blog.pageType != &quot;item&quot;'>
<div expr:id='&quot;summary&quot; + data:post.id'/>
<script type='text/javascript'>
var blogID = &quot;937920098338306331&quot;;
function retriveSummaryPost<data:post.id/>(json){document.getElementById(&quot;summary<data:post.id/>&quot;).innerHTML
= json.entry.summary.$t + &quot;...&quot;}

function createSummaryPost<data:post.id/>(POSTID){ var script =
document.createElement(&quot;script&quot;);
script.src = &quot;http://www.blogger.com/feeds/&quot;+blogID+&quot;/posts/summary/&quot;+POSTID+&quot;?alt=json-in-script&amp;callback=retriveSummaryPost<data:post.id/>&quot;;
script.type = &quot;text/javascript&quot;; document.getElementsByTagName(&#39;head&#39;)[0].appendChild(script);
}
</script>
<script type='text/javascript'>
createSummaryPost<data:post.id/>(&quot;<data:post.id/>&quot;);
</script>
<span class='rmlink' style='float:right'><a expr:href='data:post.url'>--&gt;Read more...</a></span>
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='post_body'><data:post.body/></div>
</b:if>


Please replace the number 937920098338306331 by your blogID. You can read here to know how to get the blogID.

4 comments:

zeke said...

Hi EasyAdsenseVn,

I checked out your new method and it's great that you're offering it. But I think the issue isn't that the "Read More" hack isn't automated enough. It's that the people who tend to want it only want it on-call, not full-time.

Wordpress offers it as a WYSIWIG in its edit window which allows the writer to use it or not per post. It think that's the hack we're all looking for, even if it's HTML code to insert per post, rather than through the template.

If there was a hack that was neither too long nor too complicated, I think you, or Kevin, will have hit the Holy Grail of the "Read More" quest, but "per" post HTML, not "all" posts HTML.

I left this comment on "Crovess" as well.
Thanks,
zeke

EasyAdsenseVn said...

Hi Zeke,
first of all, thanks for your attention to my post.
As you have said, when you apply this method, all the posts will change automatically. I prefer to do it! However, there are many short posts, many people want to keep full post without Read More. Of course they don't want to do per post with < span class="fullpost"> and </span>. I have seen some where on the Web how to fix the problem. Let me search for it!
One more thing, the method that I have introduced here to add "Read More" can not display the icon image of the post. I shall introduce in a minute one new method which has the property above!
Thanks again for your attention!
Welcome for valuable comments!

Kevin Tan said...

Hi easyadsensevn,

Nice info and thanks for sharing this trick. This half-automated read more hack does help when a blog author has bunch of existing long posts in his/her blog and don't wanna add the <span class="fullpost> into the messy codes of every single post. However, it's not fully automated though.

Without a doubt, WordPress does the best on the "Read More" part. We, as a Blogger user, are still looking for a way to tweak Blogger better on the "Read More" hack just like WordPress.

EasyAdsenseVn said...

Dear Χ.E.R.O,
thanks for your interesting in my blog.
I have visited your blog, and I would like to say: wonderful blog!
For your problem, you should use a new method to add "Read more" hack here:http://easyadsensevn.blogspot.com/2008/09/how-to-add-blogger-read-more-expandable_05.html
For that method, you can change the length of Summary_noimg or Summary_img, depending on whether your post has representative picture.
All the best!

Enter your email address:

Delivered by FeedBurner

Watch the latest videos on YouTube.com
Your Name :
Your Email :
Subject :
Message :
Image (case-sensitive):