Gossamer Forum
Home : Products : Gossamer Links : Discussions :

links from certain category on first page

Quote Reply
links from certain category on first page
Hello guys, need some help...
Question - how is it possible to put links from certain category on first (main) page, lets say i need to put 50 links and to have two tables with 25 and 25 by their ID - first table first 25, second table last 25 links from that category, also in which file i can make changes of how those links will look like
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.