Score:0

How can I display @total in view display rest export in json format?

br flag

In a block or page display view i can put Result Summary @total in header. But in rest export display view does not use header plugins.

How can i get @total in rest export json format?

I have search in drupal.org and StackExchange, but no luck.

Is there a way to get @total Drupal 9?

Kevin avatar
in flag
I recently released a module to do this: https://www.drupal.org/project/views_rest_serializer_extra
Score:0
mv flag

You will have to create a custom serializer in a custom module as shown in https://gist.github.com/svetlio/79f3c32667b21d89ed03cdb660308668 and select the "Custom Serializer"(custom name you give for serializer) in the Views Display as shown in the figure below

enter image description here

As @kevin suggested there is a module for this now - https://www.drupal.org/project/views_rest_serializer_extra

Kevin avatar
in flag
This has more features. https://www.drupal.org/project/views_rest_serializer_extra
tinohuda avatar
br flag
Thank you, ill look at your module
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.