# # IfTemplateType # # 2006/01/27 1.00 First version # 2007/01/15 1.01 Modified # # Copyright(c) by H.Fujimoto # package MT::Plugin::IfTemplateType; use strict; use MT; use MT::Template::Context; use MT::Plugin; # show plugin information to main menu my $plugin = MT::Plugin->new({ name => 'IfTemplateType', description => 'Check template type.', version => '1.01', author_name => 'Hajime Fujimoto', author_link => 'http://www.h-fj.com/blog/', }); MT->add_plugin($plugin); # add tag MT::Template::Context->add_conditional_tag(IfTemplateType => \&if_template_type); # main sub if_template_type { my ($ctx, $args) = @_; my $at = $ctx->{current_archive_type}; $at = 'Index' if ($at eq ''); my $is = ($args->{type} =~ m/($at)/); $is; } 1;