Adding a WYSIWYG editor to Movable Type

2005 October 20
by Karen

The first step to getting WYSIWYG editing for Movable Type is by adding the EnhancedEntryEditing plug-in. The directions on this page a very good and they will help you get the plug-in installed and working in a snap.

So you’ve added the plug-in, but you notice that whenever you create a new blog you are missing the WYSIWYG editing. This can easily be corrected by going into the New Entry Defaults tab of Settings and changing the text formatting drop-down to “WYSIWYG”. However, you don’t want to have to remember this everytime you create a blog. Wouldn’t it be nice if everytime a new blog was created it got the WYSIWYG editor by default? Yes, it would. So here is how you make it happen.

Go to the Blog.pm file which is located in where_your_MT_was_installed/lib/MT . The file has a section called sub set_defaults that looks like this

sub set_defaults {
    my $blog = shift;

    require MT::ConfigMgr;

    $blog->days_on_index(7);
    $blog->entries_on_index(0);
    $blog->words_in_excerpt(40);
    $blog->sort_order_posts('descend');
    $blog->language(MT::ConfigMgr->instance->DefaultLanguage);
    $blog->sort_order_comments('ascend');
    $blog->file_extension('html');
    $blog->convert_paras(1);
    $blog->allow_unreg_comments(1);
    $blog->allow_reg_comments(1);
    $blog->allow_pings(1);
    $blog->moderate_unreg_comments(MT::Blog::MODERATE_UNTRSTD());
    $blog->moderate_pings(1);
    $blog->require_comment_emails(1);
    $blog->allow_comments_default(1);
    $blog->allow_comment_html(1);
    $blog->autolink_urls(1);
    $blog->allow_pings_default(1);
    $blog->require_comment_emails(0);
    $blog->convert_paras_comments(1);
    $blog->email_new_pings(1);
    $blog->email_new_comments(1);
    $blog->sanitize_spec(0);
    $blog->ping_weblogs(0);
    $blog->ping_blogs(0);
    $blog->ping_technorati(0);
    $blog->archive_type('Individual,Monthly,Category');
    $blog->archive_type_preferred('Individual');
    $blog->status_default(1);
    $blog->junk_score_threshold(0);
    $blog->junk_folder_expiry(60); # 60 days
    $blog->custom_dynamic_templates('none');
    $blog->internal_autodiscovery(0);
    $blog->basename_limit(30);
#    $blog->server_offset(0);
    $blog->children_modified_on('20101231120000'); # something far in the future to force dynamic side to read it.
    $blog;
}

Find the line:

    $blog->convert_paras(1);

and change it to

    $blog->convert_paras('tinymce');

This will make the default in the New Entry Defaults tab of Settings to be the WYSIWYG editor for every new blogs henceforth.

No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

You must be logged in to post a
video comment.