How can I get views to group upper and lowercase together?

I have the title field added twice in the view and the second instance under REWRITE RESULTS I have "Trim this field to a maximum length" of 1. My view is grouped by this second field (so the first letter of the title.)

I have tried glossary mode with a contextual filter and that also didn't yield results.

Do I have to convert the field with strtoupper in a view template to achieve this?

1 Answer 1


In Drupal 8, a workaround is with twig. Choose the option to Override the output of this field with custom text and then use twig to capitalize.

{{ my_field|upper }}
  • Thanks. It is drupal 7. I don't want to rewrite the field with php due to security reasons and adding a span to create upper case doesn't seem to work.
    – kmharrell
    Jul 30, 2020 at 1:13

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.