I've searched high and low but can't find the answer to this one with the latest release of FCKeditor (a superb product btw!)
I've removed the ability for users to browse for links or see advanced attributes:
FCKConfig.LinkDlgHideTarget = true ;
FCKConfig.LinkDlgHideAdvanced = true ;
FCKConfig.LinkBrowser = false ;
But... I'd like to add code so that when someone selects a link it will by default open in an external window, i.e. "target = _blank"
Can anyone suggest where I can include this?
I've removed the ability for users to browse for links or see advanced attributes:
FCKConfig.LinkDlgHideTarget = true ;
FCKConfig.LinkDlgHideAdvanced = true ;
FCKConfig.LinkBrowser = false ;
But... I'd like to add code so that when someone selects a link it will by default open in an external window, i.e. "target = _blank"
Can anyone suggest where I can include this?
RE: link target = blank
RE: link target = blank
I think I have a solution here.(if you're still looking for one
In fck_link.html, search for the following code: <select id="cmbTarget"
within this selector, change the line: <option value="_blank" fckLang="DlgLnkTargetBlank">New Window (_blank)</option> to read:
<option value="_blank" fckLang="DlgLnkTargetBlank" selected="selected">New Window (_blank)</option>
next, look for the line: <input id="txtTargetFrame" style="WIDTH: 100%" type="text" onkeyup="OnTargetNameChange();" onchange="OnTargetNameChange();" />
and change it to: <input id="txtTargetFrame" style="WIDTH: 100%" type="text" value="_blank" onkeyup="OnTargetNameChange();" onchange="OnTargetNameChange();" />
This does still allow end-users to change the link target, but if they don't select anything, default will be _blank. I've just made this change myself and it works for me.
allthough I have not properly tested it with all possible browsers, I'm quite sure it will be ok since you only change some defaults within a form, no big risks there
hope this helps
RE: UPDATE link target = blank
when you edit the line: <option value="_blank"
don't forget to remove the selected="selected" from the line:
<option value="" fckLang="DlgGenNotSet"><not set> etc.....
cheers
RE: link target = blank
There really should be a config option for this. I'd put it right below the tab hide flag like so:
FCKConfig.LinkDlgHideTarget = true;
FCKConfig.LinkDlgDefaultTarget = '_blank';
Works in Firefox 1.5 and IE 7 on WinXP.
RE: link target = blank
RE: link target = blank
Something like:
This works for me, but I'm trying to come up with a way of adding "_blank" to all outbound links but not to any internal site links.
RE: link target = blank
OK
I cobbled this together from an old script I found on Sitepoint and have been using for ages (http://www.sitepoint.com/forums/showthread.php?t=149232)
There's probably a much easier way of doing this but I just needed a solution quickly.
Hopefully it will work for you