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

Global to catch category list

Quote Reply
Global to catch category list
This global should catch top level categories and display it accross all site.

Code:
sub {
my $tags = shift;
my $cat_db = $DB->table('Category');
my @root_cats = $cat_db->select (['Full_Name'], { FatherID => 0 })->fetchall_list;
my $output;
foreach my $root_cat (@root_cats) {
my $url = $cat_db->as_url($root_cat);
$output .= qq~<li class="detail"><a href="$url">$root_cat</a></li>~;
}
return $output;
}

However, it doesn't work good. When I'm in root, it's ok. But when I go in some subdirectory, URL to displayed TOP LEVEL categories isn't right.

I like PHP but dislike PERL so don't know how to fix it Wink

Regards.

UnReal Network
Subject Author Views Date
Thread Global to catch category list DeadMan 4261 Oct 16, 2009, 9:15 AM
Thread Re: [DeadMan] Global to catch category list
Andy 4158 Oct 16, 2009, 9:37 AM
Thread Re: [Andy] Global to catch category list
DeadMan 4184 Oct 16, 2009, 9:54 AM
Thread Re: [DeadMan] Global to catch category list
Andy 4174 Oct 16, 2009, 10:07 AM
Thread Re: [Andy] Global to catch category list
DeadMan 4165 Oct 16, 2009, 10:23 AM
Thread Re: [DeadMan] Global to catch category list
Andy 4152 Oct 16, 2009, 10:27 AM
Thread Re: [Andy] Global to catch category list
DeadMan 4160 Oct 16, 2009, 10:42 AM
Post Re: [DeadMan] Global to catch category list
Andy 4177 Oct 16, 2009, 10:44 AM