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.
Hi there,
I was wondering if we can add an option to trim the field's output before printing it out.
Like the default trimming option the core already has.
If it makes sense, I created a patch as a starting point.
Thank you!
Comment | File | Size | Author |
---|---|---|---|
#6 | title-add_trim_option-2270177-6.patch | 2.51 KB | jsacksick |
#4 | trimming_option-2270177-4.patch | 2.53 KB | apanag |
#1 | trimming_option-2270177-0.patch | 2.51 KB | apanag |
Comments
Comment #1
apanag CreditAttribution: apanag commentedComment #2
cornelyus CreditAttribution: cornelyus commentedI came to the issues looking exactly for this.. when I have linked and wrapped but in some occasions need to trim also.
Updated module to dev version, applied path with netbeans but have myself an error on
title.field.inc
Looked to patch and here
is it missing } to close the if?
Comment #3
apanag CreditAttribution: apanag commentedHi cornelyus!
You 're right. I can see the bracket in my code, but not in the patch (strange).
I will upload a new patch in a few mins.
Thanks for mentioning it.
Comment #4
apanag CreditAttribution: apanag commentedHere it is.
Comment #5
cornelyus CreditAttribution: cornelyus commentedno problem,
thank you!
Comment #6
jsacksick CreditAttribution: jsacksick commentedI found an issue with the path,
$item['format']
is not defined. When you apply the patch you get a lot of warnings if you previously had title fields set up, I added a !empty check in order to fix this.Comment #7
PolHi,
Thanks for the patch, it makes sense.
Comment #8
alex_optim+1
Comment #9
pifagorComment #10
pifagorComment #12
pifagorI was forced to rebuild the patch