Skip to content

ExpressionEngine Pagination and the Dynamic Parameter

While working with an ExpressionEngine based site I ran across a listing of a weblog that could contain 1000′s of posts yet as it was displayed with the Dynamic Parameter off there was no stock way to support Pagination of the items. I used a simple hack, shown at the end of the post, that allowed me to use the pagination but it shows a bigger issue with ExpresionEngine, while it may not come up that often there still should be pagination for any exp:weblog:entries set but it is not. There is no reason that non-dyanmic listings shouldn't be paginated if anything it would be more likely needed as they are likely to be a long list of a whole set.

The hack I used to enable pagination while the dynamic="off" was available here on the ExpressionEngine Wiki but as it is a wiki I felt that I should give you the basics here as well.

In system/modules/weblog/mod.weblog.php find the comment “Parse page number” you need to simply remove the AND $dynamic from the if statment to allow for the pagination use inside a non-dynamic weblog listing.

Start with:

1
2
3
4
 
if (preg_match("#^P(\d+)|/P(\d+)#", $qstring, $match) AND $dynamic)
{
...

Change to:

1
2
3
if (preg_match("#^P(\d+)|/P(\d+)#", $qstring, $match) )
{
...

  • LnddMiles

    The best information i have found exactly here. Keep going Thank you

  • phoebe

    I tried this, and it's not working yet, but this is the closest I've come. Do you have any more info on this? the wiki on the EE site is not there (anymore?)…. Trying to get pagination working in an entry that is called from a tag that needs to have dynamic=off. tricky! no way yet to do it…

  • http://blog.jeffbeck.info/ Jeff

    This worked with the 1.x version I can not speak to the 2.x versions sorry.