MT QuickPost hack

| No TrackBacks

Since I started blogging with Movable Type, I've been using a feature formerly called Bookmarklet, now called QuickPost, for posting articles referencing other web pages. One thing that's driven me nuts is that I always had to go in and add the text 'target="_blank"' inside the link URL, so that folks clicking it would get a new window with that link instead of automatically being taken away from my pages and having the link open in that same window. Anyway, I finally dug into the code that the QuickPost code uses and found a fix.

The relevant file is (for my installation) /CGI-Executables/lib/MT/App/CMS.pm, your actual path may vary.

if ($q->param('is_bm')) {
    $param{selected_text} = $param{text};
    $param{text} = sprintf qq(<a title="%s" href="%s">%s</a>\n\n%s),
        scalar $q->param('link_title'),
        scalar $q->param('link_href'),
        scalar $q->param('link_title'),
        $param{text};

The 3rd line there is the key, the one that actually puts the link into the web page. Simply change it to read as follows, and save the file:

        $param{text} = sprintf qq(<a title="%s" href="%s" target="_blank">%s</a>\n\n%s),

Now, open your Bookmarklet/QuickPost, and the revised link should now be used. Of course, you will need to revise this code each time you upgrade, so you may want to make a note somewhere to yourself about this. ;)

No TrackBacks

TrackBack URL: http://www.wrightthisway.com/cgi-bin/mt/mt-tb.cgi/161

November 2010

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30        

About this Entry

This page contains a single entry by Jim published on February 27, 2005 9:18 PM.

USB card search was the previous entry in this blog.

Shuffle Raid wrapup is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 5.031