Gossamer Forum
Quote Reply
Linktext problem
Hi everybody

i use this global

sub {

my $ID = $_[0] || 0;
my $cat_db = $DB->table('Category');

my @root_cats = $cat_db->select (['Full_Name'], { FatherID => $ID })->fetchall_list;

my $output;
foreach my $root_cat (@root_cats) {
my $url = $cat_db->as_url($root_cat);
$output .= qq~<a href="$CFG->{build_root_url}/$url">$root_cat</a><br>~;
}

return $output; }



the linktext of the result is Full_Name of the category
is there a possibility to use only the Name of the category for the linktext

please help

Marina
Quote Reply
Re: [mkoenig] Linktext problem In reply to
sub {

my $ID = $_[0] || 0;
my $cat_db = $DB->table('Category');

my $sth = $cat_db->select (['Full_Name','Name'], { FatherID => $ID });

my $output;
while (my ($root_cat,$root_name) = $sth->fetchrow_array) {
my $url = $cat_db->as_url($root_cat);
$output .= qq~<a href="$CFG->{build_root_url}/$url">$root_name</a><br>~;
}

return $output; }