Page 1 of 1

Target = _blank / New Window ?

PostPosted: Tue Jun 02, 2009 3:18 pm
by lupker
Hi all,

Love this editor, because it is just so very basic and the code is clean. Very nice.

Because I am no programmer, I would like to ask your help to add an extra field to the dialog windows Link and Image.
This field contains a radio button with "show in a new window". That's it... Can anyone help with this?

Second question: how to you style the dialog windows in css ?

Again: nice work !!!

Gr,
Mark

Re: Target = _blank / New Window ?

PostPosted: Wed Jun 03, 2009 6:26 pm
by mr_lundis
Hi Mark, and welcome to the WYMeditor forum!

First question:
The target attribute isn't included in the (X)HTML Strict specification, as it's considered a frame feature. Therefore there's no option for this in WYMeditor either. Besides a lot of people find it annoying when links open in an new window/tab without them choosing so.

I'd encourage you not to force links to open in new windows/tabs as it's a bad practice anyway, but If you really need to open links in new windows there are ways to do do. The most common approach is to use JavaScript so make links with a special attribute or class open in a new widow.

Second question:
Take a look at the skin.css-file (wymeditor/skins/<skin name>/skin.css).

Cheers! ;)

Re: Target = _blank / New Window ?

PostPosted: Thu Jun 04, 2009 1:09 am
by lupker
Hi mr Lundis,

Thanks for your reply. You are right the target element isn't xhtml strict. Although I my case, the editor is used for a profile website.
So all links inside the users profile should go to a new window. Guess I would go for the javascript with the special attributre. Any help with this would be appreaciated !

A the skin.css, i will give it a better look ;-)

Thanks again and good luck with this great piece of software !

Gr,
Mark

Re: Target = _blank / New Window ?

PostPosted: Thu Jun 04, 2009 8:52 am
by mr_lundis
Hi!

Here is one possible solution:
http://www.sitepoint.com/article/standa ... t-world/3/

Or using jQuery:
Code: Select all
$("a[rel='external']").click(function(){this.target = "_blank";});


Both of these requires you to add rel="external" to the links you want to open in a new window.

Re: Target = _blank / New Window ?

PostPosted: Sat Aug 21, 2010 1:01 pm
by BillyRayPreachersSon
I've posted a new thread here with details of how to add this as an option in WYMeditor v0.5 RC 2.

Dan

Re: Target = _blank / New Window ?

PostPosted: Tue Sep 14, 2010 1:34 am
by Nicole34
Thanks for the details...
It is very appreciated.
Godspeed..make money online