Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Links to links in category description

Quote Reply
Links to links in category description
Is there a way to call a few of the links from a category to be displayed as part of the category description?
Quote Reply
Re: [loxly] Links to links in category description In reply to
Kinda =)

In subcategory.html, change <%Description%> to <%get_related_links($ID)%>.

Then, make a new global called get_related_links.

Code:
sub {

my $catid = $_[0];
my $cltbl = $DB->table('CatLinks');
$cltbl->select_options('ORDER BY RAND(CURTIME())','LIMIT 5');
my @links;
while (my $hit = $sth->fetchrow_hashref) {
my $link = $DB->table('Links')->get($hit->{LinkID});
push @links, $link;
}
return { rand_links => \@links };
}

Then, use;

Code:
<%if rand_links%>
<%loop rand_links%>
<%include link_short.html%>
<%endloop%>
<%endif%>

..and then just make a new template called link_short.html =)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!