« Home | Next: Stats Hack: Show your page stats »
| Next: Got Hacks? »
| Next: Template Tricks »
| Next: Wishlist »



Monday, April 04, 2005

Next Post Hack

Movable Type & other templates allow you to have a link bar across the top and bottom of link posts with links to the previous item and the next item in your blog, by title.

You can do this in Blogger now, too. While hacking the Kubrick template for Point-N-Click, Michael Heilemann included this very cool hack.

Code:
<itempage><div align="center">« <a href="<$BlogURL$>">Home</a> <BloggerPreviousItems> | <a href="<$BlogItemPermalinkURL$>">Next: <$BlogPreviousItemTitle$></a> »</div><div style="display:none"></BloggerPreviousItems></div></itempage>


Notes:

  • This line of code must be outside the Blogger tags. If you have to, close the Blogger tag (</Blogger&rt;), paste the code in, then reopen the Blogger tag.
  • Right now, this will only show up on Post Pages, the pages of your individual items. To show on all pages, remove the <itempage> and </itempage> tags.
  • It seems the best place for this is at the top of the posts on the page. In most Blogger templates, just before the Blogger tag is opened the first time is usually great!


9 Comments:

Blogger யாத்ரீகன் said...

if you have a Next Option Hack , i can use this .. its nifty...

1:47 PM  
Blogger Cortland said...

fantastic! Thanks...

8:25 PM  
Blogger FirstandGold said...

Hello,

I have been trying to use your Previous post hack, but I am having one problem. See the code works, but my previous post section is putting my most recent post first on the list. Thus, instead of going to the next post, it goes to the current post.

Should do this:
Post A w/link to B
Post B w/link to C

But mine does this:
Post w/link to A
Post B w/link to B

- Taylor

7:39 PM  
Blogger Robert Merrill said...

FirstAndGold--

I looked at your site and I can't tell that you have the code on there right now. But, I am guessing what's happening is that you are showing the tool on the mainpage, not the itempages.

This works best on item pages.

Here's my code:

<itempage><div align="center">« <a href="http://templatetricks.blogspot.com">Home</a> <BloggerPreviousItems> | <a href="<$BlogItemPermalinkURL$>">Next: <$BlogPreviousItemTitle$></a> »</div><div style="display:none"></BloggerPreviousItems></div></itempage>

The other thing interesting about my page that you may not have noticed is that you can't go right to a "home" page on my site--you get immediately redirected to the first post. Here's the code to do this. It is in my template immediately after the <head> tag:

<blogger>
<Mainpage>
<script language="JavaScript">
<!--
document.location.replace('<$BlogItemPermalinkURL$>');

//-->
</script>
</Mainpage>
</blogger>

See if all of this helps!

10:18 AM  
Blogger FirstandGold said...

yup you were right. the problem was main page verse post pages. you have to click once ot get to the post page then again to get to the previous post. but i can iethre do that, or use your code to force the first post to be the main page. thanks

8:31 PM  
Blogger Tim Warnock said...

You're linking to the previous post but calling it "next". That doesn't actually provide the functionality of having both "previous" and a "next" link the way MT handles it.

Does anyone know an easy way to do that in blogger?

7:32 PM  
Blogger Henke said...

I have the exact same problem as Tim Warnock describes. I want to be able to go back and forward.

This because Im putting up a photoblog with only one post per page.

If anyone have a clue, please contact me :)

4:16 PM  
Blogger William said...

Peanuts is one of the ingredients of dynamite.Contact Lenses

3:39 AM  
Blogger Nikola said...

The only word in the English language with three consecutive sets of double letters is "bookkeeper".car insurance quotes

8:25 AM  

Post a Comment

<< Home

Other Recent Posts

Powered by Newsgator
Technorati search

Noted Links & Offers:

There's nothing like getting stuff for free. These offers are a lot like that!





Internet Services

Sick of the World Wide Wait? Upgrade your Internet:

Netscape Internet Service - Unlimited access, personalized email and search enhanced by Google. Try it! Only $9.95/mo.

Up to 5X faster than regular dial-up! Try PeoplePC Online Accelerated 3 months, half price and then pay just $15.95/month.

Download CallWave (Free!) and never miss another call while you're online.

Blogs You Should Visit

megabits per second
How to get the most out of your Internet service. Broadband, hi-speed Internet, tips, networking, hacks and the broadband buzz...

Point-N-Click
This blog is why blogs were invented. Like the kicker says, "Save your bandwidth, the cool stuff is already here."

Contributors Wanted

Do you like tweaking templates? Are you a Blogger fan? If you want to be a contributor and get famous (or, at least get blogged about), let us know! Email templatetrickster at gmail dot com

Archives

April 2005

November 2005

December 2005

January 2006