Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Remove the Underscore in Categories?

Quote Reply
Remove the Underscore in Categories?
Hello,

I am trying to find out if there is a way to display spaces instead of underscores in my category and sub category names?

If there is a mod what is the name so that I can search for it?

TIA,

Last edited by:

donm: Jan 6, 2006, 7:19 AM
Quote Reply
Re: [donm] Remove the Underscore in Categories? In reply to
Where are you having this problem? Main index page, subcat pages? Is it the linked title?


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Remove the Underscore in Categories? In reply to
Well, I am just getting started - and since I posted I noticed that the when the pages are built the underline actually takes care of the underscore in the categories.

I want to add subcategories to the index page... first, how do I do that, and second I want to add them and the underscore not show up in the sub cats.

thanks for responding -
Quote Reply
Re: [donm] Remove the Underscore in Categories? In reply to
The mod in this post will put subcats on your index page:
http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=234274#234274

Anything that goes through &build_clean [ie: $category_name = &build_clean($subcat);] will have the underscores removed. The sub, in db_utils.pl, looks like this:

sub build_clean {
# --------------------------------------------------------
# Formats a category name for displaying.
#
my ($input) = shift;
$input =~ s/_/ /g; # Change '_' to spaces.
$input =~ s,/, : ,g; # Change '/' to ' : '.
return $input;
}


Leonard
aka PerlFlunkie