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 numbersnext_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.
Dylan — 20:36 on 10.12.2011
Do you know if the page number url segment has changed to something more conventional?
Leevi Graham — 02: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.