hacking the blogger hack, part one

Written on October 20, 2006 – 2:56 am | by rayland |

Have you ever wondered how to use the expandable post summaries hack without having “Read more” message appear on every single post? Personally, I find it irritating to have a read more link on a post that doesn’t even need it…

Anyways, I will show you how to hack the expandable post summaries hack using javascript..

First of all, add these codes within your <head> </head> area and right after the closing of your style sheet..

<style>
<MainOrArchivePage>
span.fullpost {display:none;}
</MainOrArchivePage>

<ItemPage>
span.fullpost {display:inline;}
</ItemPage>
</style>

<script type=”text/javascript”>
var memory = 0;
var number = 0;
</script>

Next, you have to add the following code to your template, somewhere after the <$BlogItemBody$> tag:

<MainOrArchivePage>
<script type=”text/javascript”>
spans = document.getElementsByTagName(’span’);
number = 0;
for(i=0; i < spans.length; i++){
var c = ” ” + spans[i].className + ” “;
if (c.indexOf(”fullpost”) != -1) {
number++;
}
}
if(number != memory){
document.write(’<a href=”<$BlogItemPermalinkUrl$>”>Read more…</a><br>’);
}
memory = number;
</script>
</MainOrArchivePage>

For each post that you want to use this feature on, you will need to place this code:
<span class=”fullpost”> </span>

So let’s say that:

Here is the beginning of my post. <span class=”fullpost”>And here is the rest of it. </span>

And that’s it! If you’re wondering if this really works, it does because I just used it on this post.. Hope you enjoy it… and stay tuned I will also show you how to hack the show/hide posts hack.. Until then…

  1. 4 Responses to “hacking the blogger hack, part one”

  2. By Claire on Oct 30, 2006

    Wait! You did not get rid of the “Read more…” link… your post did not expand when I clicked on the Read more link. I did get to the page when I clicked on your post’s title link.

  3. By rdja on Oct 30, 2006

    that’s what it’s supposed to be… you must mean show/hide posts… ^_^

  4. By Anonymous on Dec 19, 2006

    brilliant.
    thanks.

  5. By rdja on Jan 26, 2007

    @anonymous: You’re welcome!

Post a Comment

*
To prove you're a person (not a spam script), type the answer to the math equation shown in the picture. Click on the picture to hear an audio file of the equation.
Click to hear an audio file of the anti-spam equation

Want to subscribe?

 Subscribe in a reader Or, subscribe via email:
  

Find entries :