0

I am trying to have the title in a view, once as the first letter, once as full title, and then have Drupal group these fields, as follows.

A
Alabama
Alaska
Arizona

C
California
Connecticut

However, when someone enters content as " Alabama" with a space as first character, I get this.

Alabama
A
Alaska
Arizona

C
California
Connecticut

I have tried removing the white space in the field settings, I tried using trim($output) on the view template.

Do you have any other suggestion?

  • translitaration module – pinueve Aug 10 at 18:01
  • White space? CSS? Who enters what where? – leymannx Aug 10 at 19:04
  • 1
    Did you try 'Rewrite Results' option in the views field where you can remove whitespaces. – Silambarasan Aug 10 at 19:07
  • I did try that. It will remove the white space sort the titles under the correct letter but then the sort criteria is still using the white space. So, say " California" has an extra space, then sort will have C, then A, then B. – kmharrell Aug 10 at 19:55
  • Sorry, I mean space. The title of a node is entered with a space in the beginning of the title. So " Alabama" instead of "Alabama" – kmharrell Aug 10 at 20:13

Your Answer

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

Browse other questions tagged or ask your own question.