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

Hpw to show the category with the newlinks global?

Quote Reply
Hpw to show the category with the newlinks global?
Hi,

I am using the topX global on the home page to show the new links.

I also want to show the category where the link is.

Need some help...

Thanks,Ron
Quote Reply
Re: [rsahertian] Hpw to show the category with the newlinks global? In reply to
Can you paste the global and then we can suggest how to modify it.
Quote Reply
Re: [afinlr] Hpw to show the category with the newlinks global? In reply to
hello LAURAaaaaaaaaaaaaa

I am very happy now, wait a moment........
Quote Reply
Re: [afinlr] Hpw to show the category with the newlinks global? In reply to
sub {
# Displays the newest songs on the home page.
my ($output,$sth,$link);
my $search_db = $DB->table('Links','CatLinks','Category');
$search_db->select_options ('ORDER BY Add_Date DESC Limit 5');
$sth = $search_db->select ( { isNew => 'Yes', isValidated => 'Yes', FatherID => '1345' });
while ($link = $sth->fetchrow_hashref) {

my $desc = $link->{'Description'};
unless (length $desc <= 30) {my $short = substr ($desc, 0, 30); $short =~ s/\s\S+?$//; $short .= " ..."; $link->{'Description'} = $short;}
$link->{'detailed_url'} = "$CFG->{build_detail_url}/$link->{'ID'}$CFG->{build_extension}";
$output .= Links::SiteHTML::display ('newsongs', $link);
}
return $output;
}
Quote Reply
Re: [rsahertian] Hpw to show the category with the newlinks global? In reply to
As far as I can see, you should have all the category tags available. If you just want the name of the category, try <%Name%>.
Quote Reply
Re: [afinlr] Hpw to show the category with the newlinks global? In reply to
Where must I put the variable <%Name%> Laura?

Blush
Quote Reply
Re: [rsahertian] Hpw to show the category with the newlinks global? In reply to
In the newsongs.html template. See what it produces - you may want the whole linked title or you may have underscores in the names which need taking out first.
Quote Reply
Re: [afinlr] Hpw to show the category with the newlinks global? In reply to
It produces exactly what I want....

SmileSmileSmile