It would be very useful if it was possible to limit the module (without requiring changes to a theme) to only apply to text within a node (or teaser) and not to text in blocks/menus. Is this possible?

Comments

quicksketch’s picture

What you'd probably want for your scenario is the External links filter module, which adds a filter you can plop onto the Filtered HTML input format so that the "ext" class is actually added by PHP. This is separate from extlink module and probably shouldn't be used in conjunction with each other.

http://drupal.org/project/elf

ugerhard’s picture

I think scedwar is thinking of something different. At least I had a similar issue and I guess that it's the same one, best illustrated by my concrete scenario:

I have a blogroll in a sidebar which contains links to several external URLs. Now extlink puts the icon next to all of these. But I'd rather not have icons next to these links, as there are lots of them beneath each other and as it's a blogroll it's quite obvious to the visitor that these are links to other sites, so the icon would be superflous. But I *do* like the icon in text links to external sites in my content area.

The short-term solution for me was to change the jQuery selector in line 29 of extlink.js from $("a").each(function(el) to $("#content-inner a").each(function(el) as my theme is based on the Zen theme and #content-inner will target the right HTML div for me.

Now, "hacking" extlink to do that is bad, I know :-) Maybe a configuration option for "power users" could be added to change to selector via Drupal's interface and which would default to a?

scedwar’s picture

I think the elf solution does in fact solve the same problem but by filtering the text. Indeed, I found a few modules that seemed to offer various approaches to the relatively simple problem of "sticking a little external link icon next to an external link". The simplest things!

quicksketch’s picture

Status: Active » Closed (works as designed)

I'm pretty sure elf is the way to go. If theres a small set of links in a block or elsewhere on your site that you wish to exempt from getting the icon, follow the suggestions in http://drupal.org/node/171541.

scedwar’s picture

I agree. Elf is pretty neat. I've just rolled it out and very impressed.