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

How to get an entry's absolute count when using pagination?

Development and Programming

upshot's avatar
upshot
85 posts
13 years ago
upshot's avatar upshot

We are using pagination with a Google Maps module. On the first page of results the entries are numbered 1,2,3,4,5. On the second page we would like to be able to display and use 6,7,8,9,10. However, each time we load a new page, the numbers reset. Does anyone know of a good way to achieve this? It’s a custom add-on we built, some I’m looking at maybe parsing the URL to figure it out but I figure there’s got to be an easier way?

       
GDmac - expocom's avatar
GDmac - expocom
350 posts
13 years ago
GDmac - expocom's avatar GDmac - expocom

For third-party modules, you probably should be asking the author of said third-party module to implement absolute_count.

edit if you’re building a module yourself, then look at how other add-ons implement pagination. There is the CodeIgniter pagination library (which is extended by ExpressionEngine, look in libraries/EE_pagination.php). You can get the per_page and current_page properties. With these and the offset property you should calculate the absolute_count yourself and offer the variable to the template parser. http://ellislab.com/codeigniter/user-guide/libraries/pagination.html

       

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.