External Link Targeting
Automatically open external links in a new tab
Last updated
Automatically open external links in a new tab
Last updated
We are planning to move this into the Rich Text lib.
In most situations, you will automatically want external links to open in a new tab.
This library automatically looks for FQDN links such as https://...
and adds a target=_blank
.
It will only add a target if none is specified.
Add the wfu-external-links
custom attribute to any link, text, or richtext element. Can also be added to DIVs.
This library has extensive configuration options.
All SA5 Url lib features are handled in a single urlConfig
configuration block, however feature-specific configurations are represented as sub objects. Typically you can enable or disable a feature, and provide a custom configuration if you choose.
Here is an example configuration for External link targeting;
Enables or disables external targeting. Defaults to false.
First, add the library as detailed in Quick Start.
Add this configuration section above right after the library in your before HEAD custom code. Typically this will be in the site-wide custom code configuration.