« Digitized Memories | Main | Why Google So Successful »

September 11, 2004

Make Blog Links Open in New Window

Blog often links to external web pages, it's better to open the link in a new window and keep the visitors stay on your Blog. I don't want to add the html code "target=_blank" every time I insert a URL, it should be possible by modifying the movable type templates.

According to my last post: Movable Type Templates, I searched MT support forum and found the thread, but this thread only works on old versions, you should follow it if you use MT 2.x.

In MT 3.x, I found all the JavaScripts moved to a central file "mt.js" under the root directory, open the file and find the following line:
setSelection(e, '<a href="' + my_link + '">' + str + '</a>');

Modify to:
setSelection(e, '<a href="' + my_link + '" target="_blank">' + str + '</a>');

Then upload this file to your web server, it will add "target=_blank" automatically when you insert a URL.



Category : Blog Issue

Posted by dvd software at September 11, 2004 12:09 AM

Comments

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Remember me?