Friday, April 28, 2006

Read More

Because I live to serve, by popular demand, I present step-by-step instructions for adding "Read more..." tags to your blogger template. Please keep in mind that all of my examples use square brackets instead of, er, pointy ones. For your purposes, you should use, er, pointy brackets in place of square brackets:

Step 1 - Somewhere between the [style] and [/style] tags in your template, add the following:

[MainOrArchivePage]
span.longpost {display:none;}
[/MainOrArchivePage]

[ItemPage]
span.longpost {display:inline;}
[/ItemPage]

span.shortpost {display:none;}
This creates two new "classes" -- shortpost, for those one or two paragraph blurbs, and longpost, for those rambling diatribes.

Step 2 - Find the [$BlogItemBody$] tag in your template. Directly underneath it, add the following:
[MainOrArchivePage]
[a href="[$BlogItemPermalinkURL$]"]Read more...[/a]
[/MainOrArchivePage]
[/span]
Obviously, you can change the text of "Read more..." to whatever you want. When you're done, it should look something like this:
[div class="post-body"]

[p]
[$BlogItemBody$]
[MainOrArchivePage]
[a href="[$BlogItemPermalinkURL$]"]Read more...[/a]
[/MainOrArchivePage]
[/span]
[/p]
Step 3 - In the text of each post that you create, you have to do one of two things:

A) If it's a shortpost for which you DON'T want "Read more..." to appear, at the VERY END of the post text, add: [span class="shortpost"] This will prevent the "Read more..." link from showing up. So, for example:
This is a short post.[span class="shortpost"]
B) If it's a longpost for which you DO want "Read more..." to appear, you have to add [span class="longpost"] and [/span] tags around the part of the post that you want to show up when readers click "Read more..." Here's an example:

Hahahaha! I have tricked the evil Dawn Summers into changing her template and completely screwing up her blog. Details to follow below.

[span class="longpost"]It all started back in '06, when Dawn was still loudly and belligerently claiming to anyone who would listen that she was 25 years old...

paragraph about me tricking Dawn.

another paragraph about me tricking Dawn.

...and that's when her pearly white smile turned into my alien baby. Great story, huh?[/span]
That's it. Obviously, this will screw up your archived posts a little, because none of them are set up to handle the new format (they'll all have a "Read more..." link at the end of them), but other than that it works pretty well. The key thing to remember is that you have to add either Step 3A or Step 3B to the text of every post.

Back to TOP