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?
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
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.