ipsure logo
Logo and Language
Login icon Language selection icon
Hello, guest
*NIX BACKUP Hands-On blog header image Right block of Hands-On blog header image Final menu block of Hands-On blog header image
MS TIP PKI PROJECTS CMS Active category menu left background Active category menu right background Türkçe HANDS-ON SERVICES IT BUSINESS CONTACT ABOUT REFERENCES TERMS RSS
Home page Hands-On Services IT Business Contact About References Terms of Use RSS

02/12/2012

Displaying the Total Number of Rows Returned by Views in Drupal 7

Filed under: CMS — Tags: , , , — Sezgin Bayrak @ 15:18

Drupal 7If you need to display the total number of rows returned by Views, you need to simply add a “Global: PHP” field in the HEADER or FOOTER of your view setup and place the following PHP code inside the Output code area. Label you give here will only be displayed administratively. Don’t forget to use <?php and ?> delimiters to enclose PHP code.

 


Output code:

<?php
$view = views_get_current_view();
$view->execute();
$count = count( $view->result );
print "<strong>Total Number of Records Found:&nbsp;".$count."</strong><br />";
?>
Related Posts with Thumbnails
Subscribe to our RSS feeds Email Subscription via FeedBurner RSS Subscription via FeedBurner
  1. How to Sum Up “Global: PHP” Field Values in Drupal 7 Views
  2. Showing username instead of My Account in Drupal 7
  3. Displaying Most Recent Wordpress Posts On Another Web Site Or A Different WP Blog

No Comments »

Trackbacks

There has not been any trackback links yet.

Reader Comments

There are currently no reader comments available at this time.

RSS feed for comments RSS feed for comments on this post. TrackBack URL

Leave a comment