There is a Movable Type plugin called mt-preview which I like, and with the update to MT3.2 the instructions for modifying MT to use this plugin are now outdated.
Therefore, I post this to help anyone googling around for an answer with respect to MT-Preview and Movabletype3.2.
The location to upload the file is the same, but the MT templates are different – so this is what I did. I used the command line, but one could just have easily used FTP, though it would have taken longer.
First, I backed up the files I was to modify
cp edit_entry.tmpl edit_entry_original.tmpl
cp entry_actions.tmpl entry_actions_original.tmpl
Then, I modified edit_entry.tmpl. This part is the same as before.
Somewhere in the section where the functions are defined, I added the function:
function doPreview () {
window.open(‘<TMPL_VAR NAME=SCRIPT_PATH>mt-preview.cgi?blog_id=<TMPL_VAR NAME=BLOG_ID>&entry_id=<TMPL_VAR NAME=ID>’, ”, ‘width=600,height=500,resizable=yes,scrollbars=yes’);
}
The window.open bit is on one line.
then in entry_actions.tmpl I found the line
<TMPL_IF NAME=ENTRY_EDIT>
and added this, immediately afterwards.
<TMPL_UNLESS NAME=NEW_OBJECT>
<input class="button" onClick="doPreview()" type="button" value="<MT_TRANS phrase="WYSIWYG">">
</TMPL_UNLESS>
What has happened here is that Sixapart spotted that the button code appeared twice in the first template, as the buttons could appear at the top or bottom of the edit_entry screen, and so they removed this code into another file, so one edit will do the job.
One Comment
You wouldn’t happen to still have a copy of the MT-Preview plugin you could email to me, would you? The listing in the plugin directory leads to a dead link – the laurentm.com website no longer exists.
—-
Here you go… it is saved as preview.pl…. I hope it survives being pasted in here! Hmm, interestingly the plugin seems to have stopped working. Take this with a pinch of salt!
# –
# Copyright (c) 2004 Laurent Mihalkovic, laurentm.com
# –
# This software is provided as-is.
# You may use it for commercial or personal use.
# If you distribute it, please keep this notice intact
# –
# –
# MT-Preview
# A Plugin for Movable Type
#
# Release 1.00
# January 3, 2004
#
# From Laurent Mihalkovic
# http://www.laurentm.com/
# –
package plugins::preview;
use strict;
use vars qw( $VERSION );
$VERSION = 1.0;
use MT;
use MT::Template::Context;
MT::Template::Context->add_conditional_tag(EntryIfPreviewMode => sub {
require Laurentm::Preview;
&Laurentm::Preview::_IsEntryPreviewMode;
});
1;