Page 1 of 1

'New Entry' ... URL button .... change/add default 'target'

Posted: Mon Aug 02, 2004 12:42 am
by plainsman
Currently, when I am writing a 'New Entry' and use the 'URL' button to place a link in the copy ... it puts a regular old link ... which is great.

However, I'd like that link to 'always' be created with the

target="_blank"

action already there. It is just a personal choice thing.

Where, in what file, would I have to edit the ".php" to make this happen?

Is it 'serendipity_entries.php' ... can't figure it out.

Is there a forum post or s9y link with a description which I can't seem to find?

Any help, much appreciated! Thank you! Serendipity is terrific. :)

Re: 'New Entry' ... URL button .... change/add default 'targ

Posted: Mon Aug 02, 2004 1:18 pm
by garvinhicking
I guess you are using the URL button in non-WYSIWYG mode?

If so, edit your serendipity_editor.js and search for the function 'wrapSelectionWithLink' - there you will find the '<a href' code, where you can just insert your 'target=...' portion.

However, remember that 'target' is an invalid attribute for XHTML1.0 - you may want to use javascript for that:

Code: Select all

<a href="http://www.google.de/" onclick="window.open('newwin', this.href); return false">google</a>
or something like that...

Regards,
Garvin.

Posted: Tue Aug 03, 2004 12:52 am
by plainsman
Thanks Garvin. I had not thought of that... good point. I'll just set a keystroke paste-it-in thingie and use the javascript. I realize it is important to be xhtml compliant ... i just don't think of it. I appreciate the tip. Thanks, again, for your help! :)