Article navigation

A blog is fine if you can find what you're looking for but, as I've set the number af articles per page to three (to keep the pages short), articles can only be found using the blog search once they've disappeared from the 'front page'.

Over the last few days I've been attempting to add article navigation to Forest Blog.

What I was after was a look similar to Thomas Muck's Dreamweaver recordset navigation suite (First, Previous, Next, Last).

My first attempt worked OK but, as Host Forest forum member SSalhi pointed out, it was fine if the blog only contained a few articles - if there were a lot, my SQL query was retrieving all the articles!

What I needed was a MSSQL Server equivalent of the MySQL's LIMIT function.

Googling around for a while, I found a promising TechRepublic discussion thread: MySQL LIMIT in SQL Server

So, all I had to do was re-write the two main SQL queries in the suggested format, add a couple of counters and write the navigation links!

View the full code and CSS for this blog modification here.

Note: If your database contains more than a couple of hundred articles, this modification will slow down your blog's page load time.