Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Articles/links by subcategory..

Quote Reply
Articles/links by subcategory..
Okay, here is what I've been working on for the last two hours...
I created a column (enum) called LinkType with the following values: 'link' and 'article'

I put:
<%if links%>
<hr size=1>
<%articlelist%>
<hr size=1>
<%linklist%>
<%endif%>

in my category template and created the following globals:

------------------------------------------------------------
sub {
# lists the articles.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY ADD_DATE DESC','Limit 10');
$sth = $search_db->select ( { LinkType => 'article'});
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link', $link);
}
return $output;
}

--------------------------------------------------------------
sub {
# lists the links.
my ($output,$sth,$link);
my $search_db = $DB->table('Links');
$search_db->select_options ('ORDER BY ADD_DATE DESC','Limit 10');
$sth = $search_db->select ( { LinkType => 'link'});
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link1', $link);
}
return $output;
}


Problem is it lists all the articles/links on the entire site on the subcategory pages, and am trying to just pull the articles/links from the subcategory???

Any suggestions....

</not a clue>
Subject Author Views Date
Thread Articles/links by subcategory.. Dinky 1055 Oct 23, 2004, 11:58 PM
Post Re: [Dinky] Articles/links by subcategory..
minesite 999 Oct 24, 2004, 3:33 AM