It would be nice to have a little icon that appears if the related link is a link external to the site.

Comments

stinky’s picture

Status: Active » Closed (fixed)

I found a drupal external links module.

jabba_29’s picture

I know this is closed, but you can easily do something like this with the jquery.js that is provided with the installation.

Make sure that it is loaded in your desired pages, then add

$(document).ready(function() {
$(function() {
  $('a[@href^=http]').not('[@href*=domain.com]').addClass('ext')
    .click(function() {
      window.open(this.href);
      return false;
    });
});

Change domain.com to your own domain, and any pages loaded will now have external links given a class name "ext".

You can then style "ext" to have an image beside it.
The example also opens external links in a new window.

HTH.

doc2@drupalfr.org’s picture

Could you tell us whereabout to put this code. In the themes' *.tpl.php files?
Thank you