Recent Topics

Automatic target="_blank"

Started by on Jul 23, 2009 – Contents updated: Jul 23, 2009

Jul 23, 2009 23:46    

Is there a way to dictate that all links include target="_blank" ?

Jul 24, 2009 09:40

Not that I know of out of the box. Would probably be easier done as a renderer plugin or something like that.

L

Sep 03, 2009 23:04

mostmodernist_jenny wrote:

Is there a way to dictate that all links include target="_blank" ?

We can hope not, as that is unbelievably irritating. If someone wants a new window, it's quite easy to do. If I don't want a new window (which are actually tabs in my everyday browsing), creating a new window anyway is a nuisance.

Sep 03, 2009 23:43

zooplah wrote:

mostmodernist_jenny wrote:

Is there a way to dictate that all links include target="_blank" ?

We can hope not, as that is unbelievably irritating. If someone wants a new window, it's quite easy to do. If I don't want a new window (which are actually tabs in my everyday browsing), creating a new window anyway is a nuisance.

True, but hey if someone wants to drive you away by trying to make you stay that is their choice...

I kinda like how links in these forum posts launch new tabs, but actually I totally prefer the trick where it launches a new tab if it is not the same domain AND gives the little icon warning you you're gonna get a new tab. Or window maybe in some browsers still.

Sep 05, 2009 04:32

EdB wrote:

I kinda like how links in these forum posts launch new tabs, but actually I totally prefer the trick where it launches a new tab if it is not the same domain AND gives the little icon warning you you're gonna get a new tab. Or window maybe in some browsers still.

From what I've seen, spawning new windows confuses newbies. By the time they realize that they're finished browsing with the new window, they have no interest in the spawning window anymore.

BTW, it does seem rather easy to do this. Just edit your theme to put the necessary HTML in the head:
<base target="_blank" />

Sep 06, 2009 18:50

i should mention i never meant windows, but tabs. (tabs are windows, too.)

But i see the problem with making all targets = blank. A checkbox, maybe, in the link url popup? Not a big deal really.

Sep 07, 2009 05:51

Actually, target="_blank" effect is already "new tab" since FF2 and IE7 days. Especially now.

You can test it here, just click the first image of the post: http://gameshogun.ws/salon/apply-now-for-star-trek-online-beta

It will open a new tab instead of a window, and it has a target="_blank" attribute.

I tested it recently with: Firefox 3.x; Google Chrome 2.x and 3.x; Opera 9.x and Opera 10.

I haven't tested it with Safari 3 Windows since I uninstalled it - I already have a WebKit browser - Chrome :p

But if your users are using browser version before FF2; Opera 9; IE7; they will get the original effect of "new windows". Also, Epiphany browser (GNOME) and it's KDE equivalent (which I can't remember right now) will open a new window. No one seems to be updating these two browsers in terms of "new window" vs. "new tab" for the target="_blank" attribute.

Now as for the "all" links. No, do not do that hehe :p What you can do instead is to manually hardcode the attribute to the links you want to have the attribute. For links found inside a blog post, you just have not to forget to add the attribute.

The script way - jQuery ^_^ There's a module that does that, it adds attributes (and even elements) if it found matches to what you want. But these won't be visible when your visitor looks at your source code.

And of course will not work if your user turned-off or blocks JavaScript. You have to check your analytics data for this, if you have more users without JS than those with JS, then it is not advisable to go this way.

Hope that helps. :D

-----
Edit:

The little icon EdB is talking about is possible via CSS2, and much more flexible in CSS3, but I haven't found a way to do this without declaring your "base" element as your domain name only.

Which will conflict with b2evolution, because it uses the base element as your "skins" URL. (I hope they change this method :p )

Sep 08, 2009 08:02

mostmodernist_jenny wrote:

i should mention i never meant windows, but tabs.

There's no way to open up new tabs. It's up to the user to customize his/her browser to allow to open in a new tab, a new window, or the same tab of the same window.

Nov 21, 2009 23:39

It would be a nice "quick code" button to have.

Nov 22, 2009 00:32

My "quick code link" button already gives me an option to add a title tag. If I leave the popup blank it uses the linked URL as the title tag. So maybe I should recode quickcode to have options for the link button? Like, a checkbox to enable the target attribute with a default of either _blank or actually blank. Same with the rel attribute: enable it as an option then declare a default value.

The drawback is how many times you have to click okay in order to make your link. Click the link button, paste in your URL, okay okay okay okay - is that okay? Assuming one used both options of course. Worst case would be click the link button, paste in your url, okay, type in your title, okay, type in or remove the target, okay, type in or remove the rel, okay.

Well ... if you turn on the option then you probably want either blank or nofollow or something on a regular basis? hmmm... could be fun. :)


Form is loading...

Secure CMS – This forum is powered by b2evolution CMS, a complete engine for your website.