Method to include certain internal links
| Project: | External Links |
| Version: | 5.x-1.6 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Transfers to external links don't get recorded in sever logs, but it's valuable information to know when a user selects an external link. It's possible to create a URL redirect for this, but extlink treats this as an internal link.
This patch causes extlink to treat any internal link that begins with "/extlink/" as an external link and, as with selected options for external links, the link can be displayed with an external link icon and/or open a new window when selected. When selected, the internal link will show up in the server's activity log.
While it's possible for links that begin with "/extlink/" to remain at the same site, for operation as described above, the link needs to be established as an external URL redirect.
| Attachment | Size |
|---|---|
| extlink_extlink.patch | 656 bytes |

#1
I'm not sure I understand how this is helpful. Are you using another module that puts "extlink/" in your anchor tags' hrefs?
#2
I'm using path_redirect to redirect to external sites. e.g.
From: extlink/google
To: http://www.google.com/
The purpose of using the redirect instead of the direct external link is to track when external links are selected.
The purpose of this extlink patch is to decorate the link as it would an external link.
#3
I think we need a more universal solution than a hard-coded path (like RegEx white and black lists or similar). This patch is too site-specific to have a wide-spread use. This is probably related to #171541: Method to exempt links , only this request is a method to include links, as opposed to exclude them.
#4
Yeah, I would tend to agree. I'm unassigning this from myself, as I'm not sure I can come up with a proper and timely solution.
The discussion at #171541: Method to exempt links doesn't seem to clearly cover all the areas of icon display and new "popup" windows.
I think a good solution would be to add one regex (or PHP code) to the extlink settings for the icon display and another regex for the popup control, instead of the current simple all-or-none setting.
I just hacked a D6 installation for this same issue.
#5
Since this issue deals more directly with a programmatic solution than #171541: Method to exempt links (which is mostly CSS work-arounds), I'm updating this issue with the solution I've added to External Links.
External Links now provides RegEx "Include" and "Exclude" patterns, with a decent amount of starter help text for people. I'll be releasing a 1.7 version shortly.
#6
Perfect. Nice work!