2009-03-24

Image

Show or Hide Your Full Post in Blogger

This is the way to show or hide your full post on the main page of your blog. This is different from my old "Read More " methods. If in old "Read More" Methods it will show "Read More" link, then if you click the link you will load and go to another page that will show your full post/articel. But with my next methode below, if you click the link you will see your full post/articel in the same page and it no needs time to load, it only expand your full post. Do you want to try it? here is the trick:
1. Login to Blogger, Chose "Layout --> Template --> Edit HTML
2. Click "Download Full Templates" link to back up your template.
3. Check on the "Expand Template Wdiget" Check Box.
4. Copy the code below and paste above this code </head>

<script src='http://kendhin.890m.com/Readmore.js' type='text/javascript'/>

5. Then find this code <div class='post-header-line-1'/> .
6. If You found it you will see a code like this:

<div class='post-body entry-content'>

or

<div class='post body'>

7. The next step is change or replace the code (Only Number 6 code) to be like this:

<div class='post-body entry-content' expr:id='"post-" + data:post.id'>
<b:if cond='data:blog.pageType == "item"'>

8. Under it you will see a code like this <p><data:post.body/></p>
9. Put the code below under it.

<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);'>[+/-] Show Full Post...</a></p>
</span>
<span id='hidelink' style='display:none'>
<p><a expr:onclick='"javascript:hideFull(\"post-" + data:post.id + "\");"' href='javascript:void(0);'>[+/-]Hide Full Post...</a></p>
</span>
<script type='text/javascript'>checkFull("post-" + "<data:post.id/>")</script>
</b:if>

10. So, the full code will like this :

<div class='post-header-line-1'/>
<div class='post-body entry-content' 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);'>[+/-] Show Full Post...</a></p>
</span>
<span id='hidelink' style='display:none'>
<p><a expr:onclick='"javascript:hideFull(\"post-" + data:post.id + "\");"' href='javascript:void(0);'>[+/-] Hide Full Post...</a></p>
</span>
<script type='text/javascript'>checkFull("post-" + "<data:post.id/>")</script>
</b:if>

11. Save Your Editing.
12. Go to menu "Setting --> Formatting"
13. On the bottom page you will see a box beside text "Post Template". Copy the code below and paste in to the box

<span id="fullpost">
</span>

14. Save your setting.
15 If you want to post an articel place your part articel above this code <span id="fullpost">. Then the remain or full post put between this code <span id="fullpost"> and this </span>
GOOD LUCK>>>>>

التعليقات:

  1. i don't have something like this data:post.body .. this is not working for me.. I use <$BlogItemBody$> instead. what can I do?

    ReplyDelete
  2. Hello,

    http://kendhin.890m.com/Readmore.js

    Your Readmore.js file is missing in the server.

    ReplyDelete
  3. Hello,

    I echo Mond's comment. I was using this code and it worked until a couple of months ago. I wasn't sure what it was but ^ comment makes sense. Is there an alternative?

    Thanks!

    ReplyDelete
  4. the script doesnt work for the las couple of days

    ReplyDelete
  5. Those looking for the missing kendhin javascript file, it seems to work to substitute as the source file:
    http://amen24.googlepages.com/Readmore.js

    per the nice person at:
    http://graphicpedia.net/?p=50

    (you may also want to save the js file somewhere as backup)

    ReplyDelete

Total Pageviews