Handle internal links (links to pages within your site) differently than external links (e.g. to nytimes.com) with the External links module. With this module you can:
- Add icons to either mailto: or external links, or both.
- Configure external links to open in a new window (or tab depending on the browser used).
- Display a confirmation message when visitors leave your site (for Section 508 compliance).
- Define regular expressions to include or exclude certain external links from this behavior.
Enabling the module
Before you can configure External links, you initially need to enable it.
- Go to Modules > Other.
- Select External Links.
- Click Save Configuration.
Now you can configure your external links.
Configuring External links
To configure external links, complete the following steps:
- Go to Configuration > External links.
- Specify if you want to add icons to either mailto: or external links, or both.
- Choose if you want to exclude links with the same primary domain.
- Specify if you want external links to open in a new window (or tab depending on the browser used).
- If you want to include or exclude specific links from your configuration, include the links in the Pattern Matching section. For example, to exclude sites that live at either example.com OR anotherexample.com, enter
example.com|anotherexample.comin the Exclude links matching the pattern field. To learn more about Regular Expressions, go to the following Programmer's guide. - Click Save configuration.
Your configuration changes are saved. Here is an example of a configuration with icons next to mailto and external links that opens external links in a new window:
Displaying a confirmation message
To alert visitors they are leaving your site, complete the following steps:
- Go to Configuration > External links.
- Select the Display a pop-up warning when any external link is clicked box.
- Enter the message you want your visitors to see, warning them that they are leaving your site.
- Click Save configuration.
When visitors click links that take them away from your site, they will receive a message alerting them.