2005-08-31

Blogger previous post link with accesskey in valid HTML

I used this trick to create a previous post link. Basically you just generate the previous posts list where you start hiding items after you have displayed the first item. This method generates valid HTML and allows you to set an accesskey which only accesses the first (visible) item.

<BloggerPreviousItems>
  <a href="<$BlogItemPermalinkURL$>" accesskey="v">Previous:<br><$BlogPreviousItemTitle$></a>
  <div class="hide"><![CDATA[
</BloggerPreviousItems>
<div class="hide">]]></div>

Update 2005-09-01: Changed ‘next’ to ‘previous’ because it makes more sense this way.

6 comments:

Anonymous said...

Good idea, but the title "Blogger next post link with accesskey in valid HTML" is a bit misleading when you're really going to a previous post. When I think of the "next" post, I usually think of a post that is more recent than the one I'm reading. (Hopefully you could understand all that)

Anonymous said...

You're right. I'll take a look at it tonight. Too bad I already use the accesskey 'p'.

Anonymous said...

Doesn't work with IE7

Randy said...

when you go to post a comment on my blog then template isn't used. It's the defualt blogger post a comment look. How do I get it to use the template for the rest of the blog?

Jasper said...

Just paste this code in your sidebar section. Don't past it between the Blogger tags. That should do it.

Anonymous said...

can there be a code which let u put like this= Previous|Home|Next.
comment here if u know
Thanks