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.
Are there any text field formatters already available anywhere? I guess the most obvious need being a "link to content" formatter?
Comment | File | Size | Author |
---|---|---|---|
#23 | title-formatters-1062814-23.interdiff.do_not_test.patch | 4.27 KB | plach |
#21 | title-formatters-1062814-21.patch | 5.12 KB | lathan |
#17 | title-formatters-1062814-17.patch | 5 KB | lathan |
#13 | title-formatters-1062814-10.patch | 4.55 KB | Andreas Radloff |
#12 | title-formatters-1062814-10.patch | 4.55 KB | Andreas Radloff |
Comments
Comment #1
Scott J CreditAttribution: Scott J commentedOr are you planning to add formatter options to this module?
Comment #2
plachWell, at the moment we are using textfields which do not provide such a formatter, however we could introduce a new one.
Comment #3
Scott J CreditAttribution: Scott J commentedThanks,
I did find an old D5 module called Text Field Tags that provides just what we need I think.
Comment #4
toxiclung CreditAttribution: toxiclung commentedsubscribe
Comment #5
BrightBoldsubscribe
Comment #6
ohnobinki CreditAttribution: ohnobinki commentedsub
Comment #7
prr2112 CreditAttribution: prr2112 commentedsubscribe
Comment #8
5keptic CreditAttribution: 5keptic commentedsubscribed
Comment #9
good_man CreditAttribution: good_man commentedField Wrappers?
Comment #10
Andreas Radloff CreditAttribution: Andreas Radloff commentedPatch against alpha3 attached that implements a field formater for linking, wrapping in a h*-tag and setting a class.
Comment #12
Andreas Radloff CreditAttribution: Andreas Radloff commentedComment #13
Andreas Radloff CreditAttribution: Andreas Radloff commentedComment #14
pyrello CreditAttribution: pyrello commented#13 appears to work. I would suggest that you have an option for -None- under the wrap tag. Also when you don't actually select an option for wrap tag, it outputs
< class=""></>
around the title.Comment #15
plach#13: title-formatters-1062814-10.patch queued for re-testing.
Comment #16
plachNeeds work per #14. Also there are some coding standard issues:
Iniline comments should start with a capital letter and end with a trailing dot. The should have their own line, also.
This should be one single line or be preceded by a single-line summary, in which case an empty line should separate them.
Missing empty line here.
Comment #17
lathanThis patch resolves all issues above
Comment #18
lathanstatus change.
Comment #19
pyrello CreditAttribution: pyrello commented@jucallme - This patch did work for me and fixes the issues above. There are a couple more tiny issues that you may want to fix prior to committing, however.
Thanks for your work on this!
Comment #20
plachIt would be nice to have also the wrapped Title without link if it does not imply too much work.
Comment #21
lathanIssues fixed, @plach you would select "Nothing" under title link to for what you are after.
Comment #22
plachCool, I'll review this ASAP :)
Comment #23
plachAwesome work everybody! I tested this for a while and looks good to go to me. I performed some minor adjustment to the patch, mainly cosmetic stuff (see the attached interdiff). The most relevant change is the following:
Basically since here (and also in other places in the Title code) we are assuming that the field has cardinality 1, we should pick the first value, not the last one. Morover I dropped the strip tags approach since we will probably allow for HTML in titles in the future.
Sorry for the long delay, committed and pushed!
Would be good to get some test coverage for this sooner or later, hence marking accordingly.
Comment #24
zennermp CreditAttribution: zennermp commentedThe search results display mode does not show the title as a link or give it a class (if specified)