Gossamer Forum
Home : Products : Links 2.0 : Customization :

Tree mod showing categories only

Quote Reply
Tree mod showing categories only
I'd like to display categories on other pages than my home page, I used Tree mod but it displays categories+subcategories+description.

I tried everything! Can't get a result!

How do I display ONLY categories name?

I looked at ALL post, resources everything in Resources, FAQ, forum and still can't find an answer.

Must be a way to display categories name ONLY with or without Tree mod. How ?

Thanks
Quote Reply
Re: Tree mod showing categories only In reply to
Hello

Is anyone succeded with this question?

Ciao

Quote Reply
Re: Tree mod showing categories only In reply to
This seems very simple so Im worried Im missing something......

Just add this to the required template sub in site_html_templates.pl

category => $category,

Then add <%category%> in the template.

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Tree mod showing categories only In reply to
Nice try, Paul...but what you have to do is hack the hopto Mod...

Regards,

Eliot Lee
Quote Reply
Re: Tree mod showing categories only In reply to
I had a feeling I was way off, hence the apprehension in my previous post. Smile

Paul
Installations:http://wiredon.net/gt/
Support: http://wiredon.net/forum/

Quote Reply
Re: Tree mod showing categories only In reply to
You could also hack some of the subs in db_utils.pl to get.......

In db_utils.pl add:


sub list_cat {
# --------------------------------------------------------
# Returns a list of all categories in the database.
#
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;

$category_list .= qq|<b>Categories:</b>
|;

foreach $field (sort keys %c) {
$field = &build_clean($field);
$category_list .= qq|$field
|;
}

return $category_list;
}




Then in site_html_templates.pl add:

list_cat => &list_cat,

Then in the template add:

<%list_cat%>


Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links
Quote Reply
Re: Tree mod showing categories only In reply to
Hello

Thanks again all Laugh

Glenn, i've tried your codes,
it's allright Laugh

but is it a way to have your subcat mod or other yahoo subcategorie mod in other page that the index of links?

a special page for this mod?

Thanks again Wink

Quote Reply
Re: Tree mod showing categories only In reply to
'but is it a way to have your subcat mod or other yahoo subcategorie mod in other page that the index of links?'

Yep can be done. You'll need to go into nph-build.cgi and copy the subs/code used to build the home page and edit them so it builds another home.html eg.. home2.html (change things such as the place it builds the page and the page name.)

Add another sub in site_html_templates.pl similar to home.html and get it to load home2.html. Then create a template called home2.html.

Good Luck!

Glenn
Host Links
http://cgi-resource.co.uk/links