0

I have a website that works with Drupal 10.2.5

I have 200 articles published.

I created a views block with the last 5 articles. I therefore limit the number of elements to 5.

I want to display in the header of my views the total number of articles, which is 200.

Here is my problem:

This does not work because the views only counts the number of elements displayed 5. How to calculate the total number of elements?

I tested all the available tokens and none are capable of doing this.

enter image description here

.

enter image description here

.

enter image description here

3
  • 1
    The tokens relate to the query being executed, so they can only give you values from that context. You could create an attachment display to the View, configure that to output the total number of articles overall, then add that attachment to the block display
    – Clive
    Apr 8 at 17:14
  • @Clive Ok thank you, can we add the attachment in the header? I have around twenty blocks to do, is that the only way?
    – marsouin
    Apr 8 at 18:00
  • I’m voting to close this question because the same is posted as a feature request, indicating the poster knows it is not possible drupal.org/project/drupal/issues/3439468. It may duplicate drupal.stackexchange.com/questions/254347/…
    – mona lisa
    Apr 8 at 21:38

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.