Wednesday, November 8, 2006

Since my friends desperate to learn how to put the read more.. so it's just show only the first paragraph. If your reader interested to read more, they just click on read more...the rest of the post will display, no need to wait for upload to new page. It's save a lot time.Also can check from Ramani and Hans.

So here we go:

Step 0:
Back-up your template before modifying it.

Step 1:
Add the following javascript code to the head of your template. You can place it just above the </head>-tag.


<script type='text/javascript' src='http://www.anniyalogam.com/widgets/hackosphere.js' />


Step 2:

Find the includable named 'post' in your template, and change it so that it is exactly as shown below (the code in red has to be added):

<b:includable id='post' var='post'>
<div class='post'>
<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'
expr:id='"post-" + data:post.id'>
<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 expr:onclick='"javascript:showFull(\"post-" + data:post.id + "\");"' href='javascript:void(0);'>Read More...</a></p>
</span>
<span id='hidelink' style='display:none'>
<p><a expr:onclick='"javascript:hideFull(\"post-" + data:post.id + "\");"' href='javascript:void(0);'>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>
</div>
.... rest of template code ....


Save your template.

Step 3:
In the Settings - Formatting tab go to the bottom and enter the following post-template:

Type your summary here.
<span id="fullpost">
Type the rest of your post here.
</span>


Now every new post you start will have a fullpost-span by default. If your post is short, you can delete the <span>-tags from the post. The post will be displayed in full, and no links with "Read more..." or "Summary only" will be displayed for that post.

To get more updates on this blog,Subscribe it now.

11 Comments:

  1. Jin Yoong said...
    Hey, thanks for this guide on adding the Read More. I also found other useful hacks from http://hackosphere.blogspot.com when I noticed that it called the script from http://www.anniyalogam.com
    Sherrykins said...
    Hi louis,

    Very interesting how to do the "read more".
    I also have posted on my blog another way to do the expandable post summaries. I'm not sure if it will work for beta, would appreciate your feedback on this matter.
    LOUI$$ said...
    @jin yoong
    thanks,hackosphere owner is my coach who always guide me in beta hack and also hoctro and vivek!most of them familiar with beta hack,check them from my links network.
    LOUI$$ said...
    @sherry

    yours code is for classic blogger only,it doesn't for beta blogger.
    Sherrykins said...
    Loui$$,

    Oh, I like the way you spell your name....hehe
    Thanks for that info, now I wonder how long classic blogger will be around, not long I'm sure. I better start thinking about the switch over and get with the beta way of doing things. :)
    LOUI$$ said...
    @sherry

    Thanks sherry,actually my name have this sign $$ because of i love $$.hehe!By the way,if you have any doubt about Blogger v3.0,just let me know!
    kickmeaway said...
    its not working for me!How!?after i done the tutorial ,my post all lost,i mean its not showing.!!
    Elmer said...
    thanks for this hacking guides, i'm following this hack, my template don't have the 3rd step code, my blog is http://kabayan-junction.blogspot.com kindly check the problem, thanks
    CyberSt0rm said...
    THanks for the info bro. Very helpful.

    cyberst0rm's tech blog
    MS Rizal said...
    how come my template never can not do the step 2. That's no includable post here...


    where i want paste the rest?
    troublemaker be said...
    nice hack, i using it. oh ya, please visit my blog at blogywalkie.blogspot.com. Is my blog good?

Post a Comment




Blogging,Tutorials,Tricks,Technology,Reviews,Gadgets,Tips and Make Easy Money Online.