Thursday, September 15, 2005

Doing it again

Well, here I am trying it again.

To see if I can get this partial post thing enabled. The damn Blogger help is such a tease: Modifying this feature is left as an exercise for the reader.

((Don't be content with only a teaser of this post; read more of this musing.))

That's BS! I want the f*cking answer, damnit.

Here's the Blogger help post:
How can I create expandable post summaries?

With this trick, you can choose to display an arbitrary amount of text from the beginning of each post, as a teaser for the whole thing. Then users who want to read the rest of the post can click a link to see the full text. This is handy if you have lots of long articles all on one page. Note that you'll need to have post pages enabled in order to make this feature work.


There are three ingredients that go into this feature: conditional CSS, a "read more" link for each post, and a modification for the posts that use this feature. So let's go through it step by step.


Conditional CSS

We're going to use conditional tags to change how posts display on different pages. Add the following code to your style sheet:

And then the help page goes on to provide the code. You know, blah, blah, blah.

So I do it, before reading the notes at the end.
  • As with any template modifications, you should be sure to save a backup copy of your template before you start. Just copy and paste all your code to a text file on your hard drive, so you'll have it there as a replacement in case anything goes wrong.
  • An alternative to creating post excerpts like this is to use the show/hide method on entire posts. Each method has its own advantages and disadvantages.
  • Advantages to this method: Customizable summaries, rather than titles only. Can be applied to some posts and not others (for instance, you might only want this for your longer posts).

  • Disadvantages: Requires changes to the posts themselves, rather than to the template only. However, the "read more" link is in the template, so it will appear regardless of whether a post has been truncated or not. (Modifying this feature is left as an exercise for the reader.)
Thanks, guys. That's really helpful.

Not.

3 comments:

  1. I completely agree. I want to add a favorites to my blog...you know where I can easily get to people I like to read, but the dang help is worthless. It's so frustrating. Who writes for those guys anyway?

    ReplyDelete
  2. That would be engineers with an engineer's sense of humor...

    ReplyDelete