Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [gres01] links from certain category on first page

Quote Reply
Re: [gres01] links from certain category on first page In reply to
Hi,

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.
Subject Author Views Date
Thread links from certain category on first page gres01 983 Nov 25, 2001, 7:56 AM
Post Re: [gres01] links from certain category on first page
Alex 951 Nov 27, 2001, 6:30 PM