Method to exempt links

belloq - August 29, 2007 - 17:18
Project:External Links
Version:5.x-1.3
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hello,
I like this module very much. For my site, I have a host of external links in blocks which are already squeezed for space. Adding in even this small icon makes line wraps happen which I don't want. If there was a way to assign a class or id to the anchor tag to signal this module to NOT create the icon, that would be super.

#1

solomongifford - August 29, 2007 - 17:41
Category:feature request» support request
Status:active» fixed

You can edit the a.ext css (see the css file in the extlinks module directory) or better yet, go to the settings page for the module and unselect the option to use the icon.

#2

belloq - September 1, 2007 - 07:22

I think you may misunderstand. I don't want to remove it from all links, just for specific ones.

#3

solomongifford - September 6, 2007 - 23:45
Status:fixed» active

Sorry for not understanding.

Find the line:

$("a").each(function(el)

in the extlink.js file and change it too;
$("a.popupclassname").each(function(el)

Now only href's with class "popupclassname" will actually popup. The rest will not.

Hope that helps.

#4

solomongifford - September 6, 2007 - 23:48

If you still want them to popup but just don't want them to show the icon, find the line:

$links.not('[img]').addClass(Drupal.settings.extlink.extClass);

and change to

$links.not('[img].donotshowicon').addClass(Drupal.settings.extlink.extClass);

Now, any url with the class donotshowicon will now show the icon but will still pop up.

#5

solomongifford - September 6, 2007 - 23:50

Sorry, I meant, "Now, any url with the class donotshowicon will not show the icon but will still pop up."

#6

belloq - October 1, 2007 - 20:01

Very cool. I will give this a try. Thanks for the reply.

#7

HolyChimp - October 2, 2007 - 03:29

You can remove the icon from certain links purely with CSS too, if you don't want to mess around with the module at all.

If you don't want the icon anywhere in your right sidebar then

#sidebar-right a.ext {
background: none;
}

should work. Replace right with left if it's the other sidebar, obviously :D

This way you won't need to edit the module each time it gets updated.

#8

kylehase - February 13, 2008 - 14:34

I use this css to remove the icon and gap from my geshifiter (code syntax highlighter) sections:

div.geshifilter a.ext {
  background: none;
  padding-right:0;
}

#9

abandoned - June 10, 2008 - 11:56

:-) just subscribing...

#10

sciman - August 23, 2008 - 21:05

This was a nifty idea, but I ran into a problem in the css used in the template I'm using. I'll show the Css first:
.rsidebar {
width: 185px;
float: left;
margin-top:-10px;
margin-right:0px;
margin-bottom:0px;
margin-left:15px;
}
Now.. I tried adding a background: none; to this series, and there was no change in the impact on the block. I'll attach a picture of the problem and would appreciate any other help. I can't see the external link icon here, but when I turn off the module, the alignment issues disappear.

AttachmentSize
external_links.jpeg 32.58 KB

#11

HolyChimp - September 17, 2008 - 20:14

it should be .rsidebar a {...} rather than .rsidebar {...}
You need to set the background on the links to none, not the whole sidebar.

#12

sciman - September 19, 2008 - 01:56

Thanks a million. I'll try that out!

#13

danorton - December 3, 2008 - 02:04

See #321690: Method to include certain internal links regarding the inverse situation, where the desire is to cause icon display and popup of local URIs.

I mentioned there that a solution to both of these might be to add one regex to the settings to specify whether or not the icon displays and a second regex to specify whether or not the link is opened in a new window.

Should this title be changed to include both situations and the other issue marked as a dup of this one?

#14

capellic - December 5, 2008 - 03:45

@kylehase: Thanks for this code. I only wanted to show the icon in the body of my site, so I modified your CSS code to remove it elsewhere:

#sidebar-left a.ext,
#sidebar-right a.ext,
#footer a.ext
{
  background: none;
  padding-right: 0;
}

#15

joshmbuck - December 16, 2008 - 18:08

Hello,

I was searching for this info as well, so thanks, but it doesn't exactly address my situation.

I, too, would suggest allowing users to list URLs they would like exempted. For instance, I have several different URLs. They are all mine, and I link back and forth between them (one for my blog, one for my photoblog, one for this, and one for that). Even though they are technically external links, they are still mine, and I don't want my viewers to think they are leaving one of my sites.

Also, I'm running a multi-site install with the module in the main modules folder, so anything I did to the module would affect all instances of it, where a list of exempted URLs would only affect that particular site.

Just a suggestion.

Thanks,

Josh.

#16

promes - February 18, 2009 - 10:45

I also am looking for a way to exempt links for a list of domains. Not only no icon should be shown but also the URL should not be turned into a link. Since I maintain a Dutch Drupal handbook site I don't want to be an URL like example.com or www.example.com be turned into a link, since this domain isn't ment to be linked to.
Good to see other people have the same wishlist for this great SEO module.

#17

quicksketch - March 14, 2009 - 05:00
Status:active» fixed

There is now a built-in solution in the to-be released 1.7 version. See #321690: Method to include certain internal links.

#18

System Message - March 28, 2009 - 05:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.