2

I need to theme the result count of a view. I am using the one provided by views in the Header of the view.

Currently, it says:

"Showing 1-10 of 200 results."

What I need to do is wrap the numbers in a span with classes to style them, so it is like:

"Showing 1-10 of 200 results."

and the bolded numbers are slightly larger and a different color, due to the styling.

I can't find these variables in twig or in the view preprocess, however. Is there a way to get them?

2
  • 1
    Can you use the [view:total-rows] token instead? Or Maybe $view->total_rows if in preprocess?
    – Clive
    Jul 3, 2018 at 18:23
  • Oh, duh. I can just put HTML in the view header in the UI instead of twig.
    – Kevin
    Jul 3, 2018 at 19:02

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.