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.

Specify Ordering with Next/Previous Tags

Fred Boyle of nGen published a great how-to last week on how to enable ordering (e.g. by entry_date) when using the next/previous tags in the Channel Entries tag pair. If you’ve tried this out-of-the-box with ExpressionEngine, you know that it doesn’t work.

screenshot of nGen EE article

Using a combination of a dozen or so lines of PHP, a Channel Entries tag pair and an embed template and variable, Fred was able to make sort by entry_date and use the previous/next pagination. He sort of recreates the basic pagination functionality right in the template. As it was noted in the comments to that article, there are other ways of going about it that don’t involve so much processing.

If you don’t need something like this right now, file it away in your reference file.

Read the whole article: ExpressionEngine and previous/next

Related: Channel Entry and Comment Pagination (EE Documentation)

Posted on Sep 13, 2010 by Ryan Irelan

Filed Under: Development Tools, ExpressionEngine 2