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.
Problem/Motivation
There are many links to the fontawesome site in Drupal\fontawesome\Plugin\Field\FieldWidget\FontAwesomeIconWidget.php. Some editors are clicking these links which takes them away from the page they're editing.
Proposed resolution
Update these links to open in a new tab.
Comment | File | Size | Author |
---|---|---|---|
#8 | open-ui-links-in-new-tab-3211059-8.patch | 14.85 KB | sonfd |
Comments
Comment #2
sonfdHere's a patch that updates all UI links in the Field Widget and Field Formatter to open in a new tab.
Comment #3
sonfdComment #4
Daniel.Moberly CreditAttribution: Daniel.Moberly commentedAuditing other issues of this type it looks like the reverse issue is sometimes filed in other modules, i.e. "Links should not always open in a new tab"
As a result, I think this is subjective on whether this is desired behavior or not and can be addressed in the theme/template layer.
Comment #5
sonfd@Daniel.Moberly - Do you have some examples? In this case, these links pull an editor away from a form they're currently editing, potentially causing them to lose their changes - that's why I'd advocate for them opening in a new tab, only to prevent that data loss. I'm curious why others are opposed to this.
Comment #6
anacolautti CreditAttribution: anacolautti at easytechgreen commentedI agree with @sonfd. In my opinion It's very annoying for end users to be taken away from their forms.
According to w3.org techniques:
There are techniques to warn the user: https://www.w3.org/TR/WCAG20-TECHS/G201.html, for example adding a warning in the link "(opens in a new tab)".
Should we implement such technique in the patch?
Comment #7
Daniel.Moberly CreditAttribution: Daniel.Moberly commentedI don't think we need a warning. I can see the argument here and would support a new patch to address this.
Comment #8
sonfdHere's a reroll of the patch from #2 against the latest 2.x-dev
Comment #9
Daniel.Moberly CreditAttribution: Daniel.Moberly commentedLooks good - thanks for the patch!
Comment #11
Daniel.Moberly CreditAttribution: Daniel.Moberly commented