O'Reilly logo

Drupal 7 Theming Cookbook by Karthik Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Styling the Drupal pager

When displaying a large number of items on a page, it is often required that we paginate the results in order to keep things simple and concise for the user as well as for easing the load on the server. Drupal uses the pager API to accomplish this and the user is presented with an interface to navigate between pages in the result-set. The pager interface typically links to the next and previous pages, first and last pages, and often, even a range of individual pages of the set.

In this recipe, we will be looking to theme this pager element and rework it to display an abbreviated page tracker instead of listing individual pages by number.

Getting ready

We will be using the myzen theme created earlier in this book as the example ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required