We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Where does the core get pagination values?

Development and Programming

Fred Boyle's avatar
Fred Boyle
73 posts
16 years ago
Fred Boyle's avatar Fred Boyle

Trying to resolve some pagination issues with our modules.

Could anyone point me in the direction of where EE inspects the URI and figures out which page you’re requesting?

Where does it find the /P2/ part of the URI and convert it into page #2 to pass on to be retrieved?

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
16 years ago
Robin Sowell's avatar Robin Sowell

A fairly simple example is in mod.gallery.php around 456:

/** --------------------------------------
            /**  Parse page number
            /** --------------------------------------*/
            if (preg_match("#^P(\d+)|/P(\d+)#", $qstring, $match))
            {                    
                $current_page = (isset($match['2'])) ? $match['2'] : $match['1'];    
                $uristr  = $FNS->remove_double_slashes(str_replace($match['0'], '', $uristr));
                $qstring = $REGX->trim_slashes(str_replace($match['0'], '', $qstring));
                $page_marker = TRUE;
            }

You can trace $qstring up, spot how it’s defined. That help?

       
Fred Boyle's avatar
Fred Boyle
73 posts
16 years ago
Fred Boyle's avatar Fred Boyle

That helps some yes. However the big issue is that I’m trying to get our Structure module, which does similar things as the Pages module, to function with pagination.

So detecting the URI segment on the end is fairly simple however I can’t seem to figure out how/where to make that information known to the pagination lookup function that makes the weblog lookup page 2 instead of 1 etc.

Any suggestions would be greatly appreciated.

       
Thorvalt's avatar
Thorvalt
23 posts
16 years ago
Thorvalt's avatar Thorvalt

Have you seen this?

http://expressionengine.com/wiki/Enable_pagination_with_dynamic_off/

Maybe this can help you to improve the structure extension, i’ve implented the hack and structure is working with listings and dynamic off.

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
16 years ago
Robin Sowell's avatar Robin Sowell

I took a quick surf around the code, but don’t think I’m fully spotting how it all hangs together. But if you point me to the relevant file and code snippet, I’ll go in and take a closer look.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.