Drupal - Display the total number of rows in the View

By xngo on January 26, 2020

In Drupal 8, you can display the total number of rows in the View. However, you need to install the Token module first.

  1. Open your view.
  2. Under the Footer section, add Result summary.
    Drupal 8 - View - Result summary
  3. Then, you use all the supported tokens:
    • @start -- the initial record number in the set
    • @end -- the last record number in the set
    • @total -- the total records in the set
    • @label -- the human-readable name of the view
    • @per_page -- the number of items per page
    • @current_page -- the current page number
    • @current_record_count -- the current page record count
    • @page_count -- the total page count
  4. When you open your view, you will see something like the followings.
    Drupal 8 - View - Result summary - Output

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.