Hello all,
I found the mod 'Category Menu' by Glennu, this will give a list/menu of top level categories anywhere on templates, but is it possible if ppl click into one of the category, it will highlight the category name, for example the photo galleries at http://www.washingtonpost.com/...tion/photogalleries/, look at into the right window the 'Photo Galleries' was highlight , is it possible ? Sorry to my english.
Please help and thanks
----------------------------------------------------------
Category Menu Everywhere Mods
In db_utils.pl add the following sub:
sub menu {
# --------------------------------------------------------
#
my (%c, @fields);
open (DB, "<$db_category_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
@fields = &split_decode ($_);
$c{$fields[$db_main_category]}++;
}
close DB;
foreach $field (sort keys %c) {
if ($field =~ m,^([^/]*)$,) {
$field2 = &build_clean($field);
$category_list .= qq|<a href= "$build_root_url/$field">$field2</a>
|;
}
}
return $category_list;
}
Then in sub html templates add in the globals section at the very top:
menu => &menu,
Then just add <%menu%> where ever you want the list of category links to appear.
http://
I found the mod 'Category Menu' by Glennu, this will give a list/menu of top level categories anywhere on templates, but is it possible if ppl click into one of the category, it will highlight the category name, for example the photo galleries at http://www.washingtonpost.com/...tion/photogalleries/, look at into the right window the 'Photo Galleries' was highlight , is it possible ? Sorry to my english.
Please help and thanks
----------------------------------------------------------
Category Menu Everywhere Mods
In db_utils.pl add the following sub:
sub menu {
# --------------------------------------------------------
#
my (%c, @fields);
open (DB, "<$db_category_name") or &cgierr("unable to open $db_file_name. Reason: $!");
if ($db_use_flock) { flock(DB, 1); }
LINE: while (<DB>) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
@fields = &split_decode ($_);
$c{$fields[$db_main_category]}++;
}
close DB;
foreach $field (sort keys %c) {
if ($field =~ m,^([^/]*)$,) {
$field2 = &build_clean($field);
$category_list .= qq|<a href= "$build_root_url/$field">$field2</a>
|;
}
}
return $category_list;
}
Then in sub html templates add in the globals section at the very top:
menu => &menu,
Then just add <%menu%> where ever you want the list of category links to appear.
http://