Hi,
You would need to use globals for this. Something like:
Home_Page_Links =>
my @output;
my $link_db = $DB->table('Links','CatLinks');
$link_db->select_options ("LIMIT 25", "ORDER BY $CFG->{build_sort_order_category}");
my $sth = $DB->table('Links', 'CatLinks')->select ( { CategoryID => 123 });
while (my $href = $sth->fetchrow_hashref) {
push @output, $href;
}
return { home_page_loop => \@output };
}
and then in your template:
<%Home_Page_Links%>
<%loop home_page_loop%>
<%row_num%>: <a href="<%URL%>"><%Title%><BR>
<%endloop%>
or something similiar.
Cheers,
Alex
--
Gossamer Threads Inc.
You would need to use globals for this. Something like:
Home_Page_Links =>
Code:
sub { my @output;
my $link_db = $DB->table('Links','CatLinks');
$link_db->select_options ("LIMIT 25", "ORDER BY $CFG->{build_sort_order_category}");
my $sth = $DB->table('Links', 'CatLinks')->select ( { CategoryID => 123 });
while (my $href = $sth->fetchrow_hashref) {
push @output, $href;
}
return { home_page_loop => \@output };
}
and then in your template:
<%Home_Page_Links%>
<%loop home_page_loop%>
<%row_num%>: <a href="<%URL%>"><%Title%><BR>
<%endloop%>
or something similiar.
Cheers,
Alex
--
Gossamer Threads Inc.