use base 'BSE::ThumbLow';
use base 'BSE::TagFormats';
-our $VERSION = "1.004";
+our $VERSION = "1.005";
my $excerptSize = 300;
}
sub iter_inlines {
- my ($args, $acts, $name, $templater) = @_;
+ my ($self, $state, $args, $acts, $name, $templater) = @_;
+
+ my $filter = $self->_get_filter(\$args);
+ $state->{parentid} = undef;
my @ids = map { split } DevHelp::Tags->get_parms($args, $acts, $templater);
for my $id (@ids) {
unless ($id =~ /^\d+$/) {
}
}
@ids = grep /^\d+$/, @ids;
- map Articles->getByPkey($_), @ids;
+ @ids == 1 and $state->{parentid} = $ids[0];
+
+ $self->_do_filter($filter, map Articles->getByPkey($_), @ids);
}
sub iter_gimages {
plural => 'allkids_of5',
nocache => 1,
state => 1 ),
- $art_it->make_iterator( \&iter_inlines, 'inline', 'inlines' ),
+ $art_it->make( code => [ iter_inlines => $self ],
+ single => 'inline',
+ plural => 'inlines',
+ nocache => 1,
+ state => 1 ),
gimage =>
sub {
my ($args, $acts, $func, $templater) = @_;
#!perl -w
use strict;
use BSE::Test ();
-use Test::More tests=>144;
+use Test::More tests=>147;
use File::Spec;
use FindBin;
BEGIN {
OneTwoThree
EXPECTED
+template_test "inlines filtered", $top, <<TEMPLATE, <<EXPECTED;
+<:iterator begin inlines @kidids filter: [title] =~ /^T/ :><:
+inline title:><:iterator end inlines:>
+TEMPLATE
+TwoThree
+EXPECTED
+
template_test "ifancestor positive", $kids[0], <<TEMPLATE, <<EXPECTED;
<:ifAncestor $parent->{id}:>Yes<:or:>No<:eif:>
TEMPLATE