Published by Mijingo

movie icon image

EE Insider Blog

Spend your time learning and developing sites with ExpressionEngine and we'll use this blog to keep you informed of all the news related to ExpressionEngine and CodeIgniter.

» Read more in the Archives.

» Have a tip? Send us your EE news.

Learn ExpressionEngine Today

Over a series of 8 videos, watch and learn as Ryan builds an entire ExpressionEngine website from beginning to end. Get started now.

Improved Pagination in EE 2.3

As part of the EE 2.3 release yesterday, EllisLab included an improvement to the pagination functionality for channel entries and comments. The old pagination navigation was a stubborn child that needed a lot of coaxing and prodding to get it to act as one wished. Well, it’s gotten better.

Now the Channel module and Comment module come with a new pagination_links tag pair that makes it a little easier to customize the pagination navigation links.

Previously, you’d do the following to get pagination links:

{pagination_links}

And that would return something that looked like this:

« First  <  24 25 26 27 28 30 >  Last »

You had no control over the markup used for that navigation. It wasn’t ideal.

With the new tag pair, you can control the output of every piece of the pagination navigation. Previously, we only had conditionals for if previous_page and if next_page but now we have tag pairs that we can use to control what markup is used to display those parts of the navigation.

You can now use the following tag pairs inside of the pagination_links tag pair:

  • first_page
  • previous_page
  • page - this one lets you control the actual page numbers
  • next_page
  • last_page

The updated EE documentation has all of the details on the new tag pairs and the variables you use inside of them. This is one of those small tweaks that goes a long way to improving how we use ExpressionEngine. For those of us who get delivered specific pagination design and markup, this is a huge improvement. It certainly is a welcome change.

Posted on Oct 12, 2011 by Ryan Irelan

Filed Under: ExpressionEngine 2

Dylan20:36 on 10.12.2011

Do you know if the page number url segment has changed to something more conventional?

Leevi Graham02:32 on 10.13.2011

Unfortunately this improvement also removed the ability to use query strings. From the docs:

http://expressionengine.com/user_guide/changelog.html

I usually use query strings for form submissions (in combination w/ Mo Variables)  eg: ?response=success or redirect=some/page.