Home > Adding modes to other Movable Type MT::App objects

Adding modes to other Movable Type MT::App objects

January 04, 2010 Mike 0 comments
An example of how to extend other Movable Type/Melody applications like the comment system with new capabilities:

In config.yaml:

applications:
    comments:
        methods:
            do_stuff: $TestPlugin::TestPlugin::Comments::do_stuff
The Perl code:

package TestPlugin::Comments;
use strict;

sub do_stuff
{
    my $app = shift;
    ###Code
}

1;
That will add a new mode to mt-comments.cgi called do_stuff which can be accessed manually with <$mt:CGIPath$><$mt:CommentScript$>?__mode=do_stuff in templates.
Categories: Tags: , , , , ,