Extlinker is a module for adding a target="_blank" attribute to the external links in your body content. It requires no special filter and works directly on the content saved to the database.
How It Works
When an entity is saved, Extlinker checks all the URLs in the body against a list of internal domains you configure in the Extlinker settings. If the href value of a link is not in that list of internal domains, Extlinker adds a target attribute to open the link in a new window.
Why?
- A lot of people like opening external site URLs in new windows.
- Sometimes, particularly with decoupled sites, you may be dealing with raw data returned from Drupal and a filter won't work because you aren't actually using a render array. You still want external links in your content's body field to open in a new tab without extra scripting.
This module was made to scratch a very particular itch.
Usage
- Enable the module.
- Configure your internal domains via:
/admin/config/content/extlinker - Write content and save the node.
Notes
Extlinker currently doesn't have any way to update existing content. If you've got existing content you'll need to resave it for Extlinker to trigger after it's been enabled.
Thanks
Extlinker is a module inspired by ELF.
Project information
Seeking new maintainer
The current maintainers are looking for new people to take ownership.Maintenance fixes only
Considered feature-complete by its maintainers.- Project categories: Content editing experience, Content display, Decoupled
5 sites report using this module
- Created by carwin on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.