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.
I need to output link to referenced entity with a custom text like: "Details..." or "Read more..." but there is no such a formatter. I think its worth it to add one.
Comment | File | Size | Author |
---|---|---|---|
#9 | entityreferrence_1822842-9.patch | 2.44 KB | adr_p |
#2 | entityreferrence_1822842-2.patch | 2.97 KB | OnkelTem |
#1 | entityreferrence_1822842-1.patch | 3.31 KB | OnkelTem |
#1 | er.png | 38.1 KB | OnkelTem |
Comments
Comment #1
OnkelTem CreditAttribution: OnkelTem commentedOk, this patch extends "Label" formatter behavior allowing for custom text.
Suggestions are welcome. Also please review the part where custom text goes through
t()
.Comment #2
OnkelTem CreditAttribution: OnkelTem commentedCode cleanup. (Warm greetings to Eclipse/PDT developers for the "smart" editor)
Comment #3
raincloud CreditAttribution: raincloud commentedI was looking for a solution like this. This patch is working very well on my site. Comparing with the screenshot, I have only "Custom Text" box and not the other boxes ("Field Template" or "Label") - perhaps those boxes come from certain other modules which I don't use.
Comment #4
OnkelTem CreditAttribution: OnkelTem commented@raincloud
Thanks for testing this.
Sorry for the confusing screenshot, those forms fields come from Display Suite module.
Comment #5
jimmynash CreditAttribution: jimmynash commentedApplied patch in #2 to 7.x-1.0 and it works great for me.
Thanks!
Comment #6
OnkelTem CreditAttribution: OnkelTem commentedTaking confirmation from #5 as the reason.
Comment #6.0
OnkelTem CreditAttribution: OnkelTem commentedasd
Comment #7
John Pitcairn CreditAttribution: John Pitcairn commentedI think this would need to be ported to Drupal 8 core entityreference field to get any further attention?
It is possible to implement the patch in a custom module providing the formatter. I can throw that into a self-contained sandbox module if anyone is interested.
Comment #8
MorinLuc0 CreditAttribution: MorinLuc0 as a volunteer and at Coldfront Labs Inc. commentedMissing test cases for new functionality.
Comment #9
adr_p CreditAttribution: adr_p commentedAdjusting for 7.x-1.5.