Drupal 6: Displaying the total number of results in a view and how many are being shown on the current page
When you have a view that has a lot of results, you could improve usability by showing how many total results there are and how many are being shown on the current page. Similar to this:
I created a function that accepts two arguments: the view name and the view’s display_id (default, block, page, etc). The function loads the view, executes it, and calculates these numbers for you.
There are a few places you can insert this code. I decided to put it directing in my view, right after my exposed filters. To do that, I created a new file in my theme called: “views-view–MYVIEWNAME–page.tpl.php”, and used the “Theme Information” section on the edit view screen to populate it with the default html & PHP. I searched for the code that inserts the exposed filters ($exposed), and inserted the following:
I enclosed it in a div with a class name so I could adjust the CSS as necessary.