Problem/Motivation

It is possible to show the total count of rows under "Header" and "Footer" in a View by inserting [view:total-rows] in the "Text area - Global" field. But it is not available as a field, like "View result counter" is.

This works for most use cases, but if you want to use the total row count together with other fields, you can't, for example in a Carousel:

[THE IMAGE]
Image 2 of 18 - Text describing the image
Photo by: xyz

I am aware that this is possible using an attachment, but that doesn't seem ideal ...

Available:
"View result counter - Global" Displays the actual position of the view result.

Add?
"View result total rows - Global" Displays the total amount of results returned from the view.

Proposed resolution

Add "View result total rows - Global" as a field option.

Remaining tasks

Add the code which will make "View result total rows - Global" available as a field option in Views.

User interface changes

A new field "View result total rows - Global" will be added under Fields in Views.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Original report by [username]

None.

Comments

ressa created an issue. See original summary.

ressa’s picture

Version: 8.9.x-dev » 9.1.x-dev
himanshu_sindhwani’s picture

Status: Active » Needs review
StatusFileSize
new189.11 KB
new10.48 KB

This can already be achieved using Global: Result summary in the header of view. Check this screenshot for more info.

settings

Adding the above in headers will result in :

result

ressa’s picture

Yes, I know. Please read the text under "Problem/Motivation" again.

ressa’s picture

Status: Needs review » Active

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.