0

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?

2

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 }}
1
  • 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 '20 at 1:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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