Open link in content in a new window?

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
Dawn
Regular
Posts: 69
Joined: Thu May 04, 2006 11:46 am

Open link in content in a new window?

Post by Dawn »

Hi,

I wanted to ask here if is possible to open a new window when a user click on a link in a blogpost...? And if yes, how can that be done...?

Greets and best regards,
Dawn
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Open link in content in a new window?

Post by garvinhicking »

Hi!

Usually this is a decision made by the browser. Your webpage should not instruct that.

You would need to put "target='_blank'" in all of your <a> links that you want to open in a new link.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Dawn
Regular
Posts: 69
Joined: Thu May 04, 2006 11:46 am

Post by Dawn »

Hi Garvin,

You've allways VERY FAST :) I know that I can use "_blank" in the <a> tag to open it in a new window. But can I do that automaticly for links in blog-posts? I don't want to get my visitors away if they click on a link. So it would be nice if that can be done in the theme. But I don't know if that's possible...

Greets,
Dawn
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

No, you cannot do that. This is because we firmly believe in the concept that a browser has to decide how to open links. If you want to override that you would need to manually add that attribute to the tag, or you will need to write a plugin that rewrites all <a> tags to <a href>, maybe you can even use the 'content rewrite' plugin for that?

But again: Believe in your visitors. Give them the power to decide themselves hwo they open a link.

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Dawn
Regular
Posts: 69
Joined: Thu May 04, 2006 11:46 am

Post by Dawn »

Ok, I can live with that. I think in some situations it would be nice to open new windows (links to wikipedia for example or other news) but it isn't very important.

Thanks for your fast answer :)

Greets,
Andy
Post Reply