Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Subcategories

Quote Reply
Subcategories
Hi,

How do I make the SubCats show up as links under the Cats.

Many Thanks

Last edited by:

ukresident: Oct 24, 2004, 3:57 AM
Quote Reply
Re: [ukresident] Subcategories In reply to
That should happen automatically...

Creat a category: Horses
Create a subcategory: Horses/Brown

Brown should now appear on the Horses category page. (Be sure to re-build.)


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Subcategories In reply to
Hi Leonard,

The Sub Categories are being created but they do not have a link on the Category page for me. Here's a link to our directory

http://www.ukresident.com/links/index.html

Thanks,

Tony
Quote Reply
Re: [ukresident] Subcategories In reply to
Site looks good, and looks like it's set up right; main page with a link to each main category. When one of those is clicked, the category page appears and has link to subcategories, and off-site links. This is the normal setup for Links. If you want the subcats to be linked from the main page (as on my site), that is a mod you have to make to the code. Pretty easy to do.


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Subcategories In reply to
Thanks Leonard,

I checked out your site and that is exactly what I'm looking to do. How do I go about performing the Mod?

Also, off-topic, Why am I unable to create a two-word category (ie. Money and Finance) it doesn't allow me to do itUnsure

Thanks so much for all your help mateSmile
Quote Reply
Re: [ukresident] Subcategories In reply to
The mod is here:
http://www.gossamer-threads.com/...string=yahoo;#234358

To make two or more word category names, you have to put an underscore between the words: Money_and_Finance


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Subcategories In reply to
Thanks Leonard for all your help! Much appreciated mateWink
All the bestSmile
Quote Reply
Re: [ukresident] Subcategories In reply to
Where do I perform these Mods? Home page?
Thanks
Quote Reply
Re: [ukresident] Subcategories In reply to
Ignore my previous post Leonard, I figured it out. Thanks againSmile
Quote Reply
Re: [ukresident] Subcategories In reply to
OK Did it but why is there a space between the Category and sub-categories? And how come it only shows 6 sub-links under Regional eventhough there are seven links.

Here is the link:

http://www.ukresident.com/links/

ThanksSmile

Last edited by:

ukresident: Oct 24, 2004, 5:34 PM
Quote Reply
Re: [ukresident] Subcategories In reply to
The space is likely a result of the definition list tags, I would remove them. Here is what I have on mine, it is a bit different tha what I linked to above. I have changed around the comma and dots at the end. You change the number of links that appear by changing the blue number. Note that I use CSS, and the tags here are based on my own stylesheet. For testing, just use HTML tags.

The 'more&#187' produces this: moreĽ


Code:
if ($#{$subcategories{$subcat}} >= 0) {
$v = 0;
$output .= qq~<div class="home-cat">~;
foreach $subcatsub (sort @{$subcategories{$subcat}}) {
$suburl = "$build_root_url/" . &urlencode($subcatsub) . "/";
if ($subcatsub =~ m,.*/([^/]+)$,) {$subcategory_name = &build_clean($1);}
else {$subcategory_name = &build_clean($subcatsub);}
$output .= qq~<a class="cat2" href="$suburl">$subcategory_name</a>~ if ($v <= 5);
$output .= qq~,&#160;\n~ if ($v ne $#{$subcategories{$subcat}} && $v <= 5);
$output .= qq~<a class="cat2" href="$url"> more&#187;</a>\n~ if ($v eq "5");
$v++;
}
$output .= qq~</div>~;
}
$i++;
}
$output .= "</div>\n";
return $output;
}



Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Oct 24, 2004, 7:34 PM