Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Featured Links on secondary pages

Quote Reply
Featured Links on secondary pages
Hi, I looked for an answer, but alas to no avail. I have set up featured links on my site, by adding a column to the links table "IsFeatured". It works great, but I would like those featured links to also appear on any spanning pages. I have build set at 25 links per page so if I have 95 links in a category, it would build all 4 pages. I would like Links to build my featured links on all 4 pages. Any suggestions. . .

thanks in advance,

Lennie
Quote Reply
Re: [lennie] Featured Links on secondary pages In reply to
I think you'll need a global to do this.

sub {
# Displays the featured links on each category page.
my ($id,$search_db,$output,$sth,$link);
$id = shift;
$search_db = $DB->table('Links','CatLinks');
$search_db->select_options ("ORDER BY rand()");
$sth = $search_db->select ( {isFeatured => 'Yes', isValidated => 'Yes', CategoryID=>$id});
while ($link = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display ('link_featured', $link);
}
return $output;
}

If you call it cat_featured then you need <%cat_featured($ID)%> in your category template. You'll also need an extra template link_featured.html (alternatively you can change 'link_featured' to 'link' in the global and use the same template.

The global will just show the featured links from that category and then all links (including the featured links) will be shown below.

Laura.