Plugins & Hacks

How can I add pagination (page navigation) to my blog?

Scenario:
"I want my blog to have links to a second page of items once there are more than X items on the front page."

Solution:
This can be achieved through 2 methods-

  1. basic pagination
  2. advanced pagination

Original forum threads (thanks, admun & roel!):
http://forum.nucleuscms.org/viewtopic.php?t=8100
http://forum.nucleuscms.org/viewtopic.php?t=9063

Basic pagination
Nucleus has two built-in variables meant for pagination. They are called prevlink and nextlink. Inside your blog, they can be used to provide links to the previous page (with newer items) and the next page (with older items).

Example of the usage
If you want to provide links to the next page or previous page of your weblog's articles, you can use the following code:

<%nextlink(Older items,X)%>

<%prevlink(Newer items,X)%>

where X is the number of items you want per page. The above code needs to be placed inside your Main Index skin part where you want the links to appear. X cannot be more than the number of blog items your Main Index page is currently displaying!

Advanced pagination
If you are looking for a more flexible solution, you can use one of the many plugins available to Nucleus.

Method:
Install one of the following plugins available.

NP_ShowBlogs is recommended as it has more functionality and does not require the installation of additional plugins. Added functionality includes:

  • Support for table prefix Nucleus installations
  • Sticky items
  • Sort items in ascending or descending order
  • Show items from specific blogs or all blogs combined
section: Plugins & Hacks | submitted by Leng on 2005.Sep.18 | 5152 views

item rate
Total votes: 13 - Rating: 6.85

Please tell us how useful this answer was to you (0 = useless, 10 = very very helpful):

10