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.
An entity reference type field can be displayed with link to label option,but there is no way to set this link's target options,and Often this feature is quite important ,I hope that our maintainer will add this feature to make it better.
Comment | File | Size | Author |
---|---|---|---|
#16 | Registration Link Formatter Link Target checkbox.png | 3.44 KB | markusd1984 |
#14 | display_add_link_target-2691943-14.patch | 1.76 KB | Arlina |
| |||
#13 | display_add_link_target-2691943-13.patch | 1.76 KB | oleg chemerys |
| |||
#10 | display_add_link_target_with_select.patch | 2.22 KB | hexblot |
#7 | display_add_link_target-2691943-7.patch | 2.05 KB | caminadaf |
|
Comments
Comment #2
brucelee1985 CreditAttribution: brucelee1985 as a volunteer and commentedComment #3
NWOM CreditAttribution: NWOM commentedSetting to needs review and removed the tags (See Issue Guidelines). Thanks for the patch. I hope this gets added to the module.
Comment #5
NWOM CreditAttribution: NWOM commentedHere is an updated patch that fixes a few white space and consistency issues. Please review.
Comment #6
badjava CreditAttribution: badjava at Metasun for Pfizer, Inc. commentedThere are still some spacing issues near the bottom of #5.
should be
Comment #7
caminadaf CreditAttribution: caminadaf at CI&T for Pfizer, Inc. commentedI've reviewed the diff using phpcs with Drupal and DrupalPractice standards, not it should be OK.
Comment #8
chinmay_p CreditAttribution: chinmay_p at TATA Consultancy Services commentedTested the patch against version 7.x-1.1.Upon selecting entity reference,It gives option to add target. When "_blank" is added in target field,it gets open in new tab.
This patch works as expected.
Comment #10
hexblot CreditAttribution: hexblot as a volunteer commentedStarted using the patch in #7 on two sites, and it works wonderfully. A small change made by me in order to help novice site builders is to abstract the textfield in favor of a simple select control (New Window vs Same Window instead of a blank text field), it should help with usability.
It is heavily based on the patch in #7 (just FAPI changes, and display).
Comment #11
spotzero CreditAttribution: spotzero at Coldfront Labs Inc. commentedActually, patch #7 has the valid behaviour. See: http://www.w3schools.com/TAGS/att_a_target.asp
Link targets can be any string when you're working with named frames.
What patch #7 needs is help text. ;)
Comment #13
oleg chemerys CreditAttribution: oleg chemerys commentedThe issue still exists in 1.4 version, so I've updated the patch #7.
Comment #14
Arlina CreditAttribution: Arlina at Chapter Three commentedUpdated the patch for version 7.x-1.5.
Comment #15
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedUnassigned @brucelee1985
Comment #16
markusd1984 CreditAttribution: markusd1984 commentedthanks @ Arlina, I used the code and made something similar for the entity registration module, and also just now changed it to use a checkbox instead of a text field since usually only the "_blank" target type is of real practical use and thus no need for custom entry i supposes.
https://www.drupal.org/project/registration/issues/3156687#comment-13732212
Code below, may need to be adjusted for ER.
The below needs more review to probably make checkbox work with ER.