Help - Search - Members - Calendar
Full Version: Dynamic publishing not using plugins?
Movable Type Community Forum > Other Product Discussion > Bugs and Odd Behavior
orangehairedboy
I tried to make my date-based archives dynamic, but I get an MT error which says that the tag is unknown.

This tag is added by the "ifarchive.pl" plugin and it works when rebuilding statically.

Do plugins have to be rewritten as PHP plugins so they can work dynamically?

Here's the code of the plugin:

CODE
package LummoxJR::ifarchive;

use MT::Template::Context;

MT::Template::Context->add_conditional_tag(IfArchive => \&ifarchive);
MT::Template::Context->add_conditional_tag(IfNotArchive => sub{!ifarchive(@_)});

sub ifarchive {
    my ($ctx,$args)=@_;
    return 0 unless $ctx->{current_archive_type};
    return 1 unless $args->{archive_type};
    my @types=split /\s*,\s*/,$args->{archive_type};
    foreach my $at (@types) {return 1 if $at eq $ctx->{current_archive_type};}
    0;
}
1;
Michael Ditto
QUOTE (orangehairedboy @ Oct 3 2004, 05:31 AM)
Do plugins have to be rewritten as PHP plugins so they can work dynamically?

Yes, they do.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.