By ghumpley on
I'm wondering if it's possible to display, ideally in a header of a view page, the number of nodes returned by the view.
Using the views theme wizard I have been able to get the number of nodes returned by adding print $view->total_rows; to the template, but then that shows up for each node returned by the view. I tried putting the same code into the header of the view but couldn't get anything to come up.
Comments
$view isn't available in Header and Footer
Hi, I had exactly the same issue and here's how I solved it for my case.
Where 'meeting' is the name of needed view. So,
views_get_view('meeting')actually returns$view. It seems that Header and Footer's variable scopes don't contain direct reference to$view, so you should get it first. I hope this will help :)Flash Teh Ripper
Ah sweetness! Works like a
Ah sweetness! Works like a charm, THANKS!!!
Does this carry over for Views 2?
I'm using Drupal 6/Views 2, and this is the exact functionality I want but I can't get the snippet to work when I embed it in a node. Do the same API calls work?