0

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?

1

1 Answer 1

1

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

2

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.