Not a developer? Go to



When a user applies a template set to a blog, Movable Type invokes this callback to allow plugins an opportunity to alter the set of templates being applied to the blog, either to amend, or to filter them.

Specific template sets can be targeted by appending the template set ID for which this callback applies, or can be applied to all template sets by omitting the template set ID.

Input Parameters

  • $cb - a reference to the current MT::Callback object handling this event.
  • $templates - an array reference to the templates being applied. Because it is a reference to the array, developers can insert additional templates into the set to be installed, or even remove templates from the template.

Return Value


Example Handler

sub handler {
    my ($cb, $templates) = @_;
    # loop over the templates
    foreach my $tmpl (@$templates) {
        # do something
    # add a template
    my $t = MT::Template->new;
    # do stuff
    push @$templates, $t;