Make external links mean what you probably think it means

Created on 20 September 2018, about 6 years ago
Updated 17 August 2023, about 1 year ago

When I saw this module's description I thought, "This must somehow figure out if the link is pointing at this site's domain or not, and add the target attribute if it isn't." When I looked at the code, I see that you are using the isExternal UrlHelper that just determines whether the link is a relative (internal to drupal path) or an absolute path. If I linked to a static page outside of drupal but on the same domain, or I put in an absolute link to a page on the Drupal site, it seems like that would also be considered an external link.

It would be nice if this module had a settings page, allowing you to set a domain pattern that would be considered as an internal link and not have the target applied. The logic would roughly go as follows:

If isExternal then check against the pattern to see if it should be considered internal anyway.

For my use case, that would make this module useful. I hope that helps.

āœØ Feature request
Status

Closed: won't fix

Version

1.2

Component

Code

Created by

šŸ‡ÆšŸ‡µJapan ultrabob Japan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • šŸ‡ÆšŸ‡µJapan ultrabob Japan

    Iā€™m sorry I had missed seeing your reply before. I have often seen the case where an org has to add some feature to their website provided by another tool, but they want to make it appear as it is all the same website. I solved it in other ways though, and if you are not getting other people making the same feature request, then closing it probably makes sense. Thanks for your work.

Production build 0.71.5 2024