Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello,
In "rewrite results" the checkbox "remove whitespace" return strings with spaces.
Also twig doesn't work:
{{ term_node_tid__name|render|lower|trim }}
{{ term_node_tid__name|lower|trim }}
{{ term_node_tid__name|trim }}
{{ term_node_tid__name|trim(' ') }}
(but 'lower' works)
What can I check?
Module version: 8.1.8
Drupal version: 8.1.8
(missing versions in issue creation, maybe I'm in the wrong forum section??)
Thanks
Comment | File | Size | Author |
---|---|---|---|
Screen Shot 2016-09-07 at 11.32.09 AM.png | 68.94 KB | frazac_naba |
Comments
Comment #2
zalak.addweb CreditAttribution: zalak.addweb commentedComment #3
LendudeMoving to the right queue (that should also reveal the right versions).
Trim only removes whitespace characters from the front and back of a string, not from inside a string. I don't think there is currently an option to remove whitespace from the string as a whole.
Does this answer your question?
Comment #4
frazac_naba CreditAttribution: frazac_naba commentedThanks Lendude! Sorry but it doesn't reply.
Maybe for my ignorance: what is the front or the back of a string?
Here a bettere explication:
Input from the field of a node:
"I'm foo"
View output expected whit "remove whitespace" activated:
"I'mfoo"
But this not happens!
Bye
Comment #5
LendudeRemove whitespace only removes any whitespace at the start and at the end of your text so " I'm foo " becomes "I'm foo"
See the php trim function
Views rewrite doesn't support the thing you are trying to do.
Comment #6
frazac_naba CreditAttribution: frazac_naba commentedOk, all right thanks.