I use some loops and they runs fine, except on the detailed.html and modify pages.
This global does not work on detailed pages:
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY ID DESC', 'LIMIT 10');
my $sth = $table->select ({ top5 => 'Yes' } );
my @output;
while (my $link = $sth->fetchrow_hashref) {
$link->{Title} = (length $link->{Title} > 30) ? substr($link->{Title},0,30) . ' ...' : $link->{Title};
push (@output, $link);
}
return { top5_loop => \@output };
}
What can be the reason that I canīt use this global at detailed and modify?
This global runs fine on all pages:
sub {
my $tags = shift;
my $table = $DB->table('Category');
$table->select_options ('ORDER BY sort DESC', 'LIMIT 20');
my $sth = $table->select ( { FatherID => '0' } );
my @output;
while (my $link = $sth->fetchrow_hashref) {
$link->{Name} = (length $link->{Name} > 30) ? substr($link->{Name},0,30) . ' ...' : $link->{Name};
push (@output, $link);
}
return { Lastlinks5_loop => \@output };
}
Itīs nearly the same, just to show categories instead links.
Any idea?
--
Michael Skaide
http://www.skai.de
--
Michael Skaide
http://www.cycle24.de
This global does not work on detailed pages:
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY ID DESC', 'LIMIT 10');
my $sth = $table->select ({ top5 => 'Yes' } );
my @output;
while (my $link = $sth->fetchrow_hashref) {
$link->{Title} = (length $link->{Title} > 30) ? substr($link->{Title},0,30) . ' ...' : $link->{Title};
push (@output, $link);
}
return { top5_loop => \@output };
}
What can be the reason that I canīt use this global at detailed and modify?
This global runs fine on all pages:
sub {
my $tags = shift;
my $table = $DB->table('Category');
$table->select_options ('ORDER BY sort DESC', 'LIMIT 20');
my $sth = $table->select ( { FatherID => '0' } );
my @output;
while (my $link = $sth->fetchrow_hashref) {
$link->{Name} = (length $link->{Name} > 30) ? substr($link->{Name},0,30) . ' ...' : $link->{Name};
push (@output, $link);
}
return { Lastlinks5_loop => \@output };
}
Itīs nearly the same, just to show categories instead links.
Any idea?
--
Michael Skaide
http://www.skai.de
--
Michael Skaide
http://www.cycle24.de