Gossamer Forum
Home : Products : Links 2.0 : Customization :

remove category underscore (new field)

Quote Reply
remove category underscore (new field)
Hi,

Ok, I've added a few fields to the category database, everything works fine. One of these new field values needs to have an underscore in it for linking purposes, not a problem so far. Now, what I'm trying to do is also print that name without the underscore (much like <% category_clean %> will do) but I need to apply that same effect to this new field. I haven't been able to figure out how it works with the category_clean tag...so if you have any ideas where this process takes place, so I can try to apply it, that would be great! Thanks.

Quote Reply
Re: remove category underscore (new field) In reply to
Simply add the following codes in the sub site_html_category routine in the site_html_templates.pl file:

Code:

my $fieldname = $rec{'FieldName'};
my $clean_fieldname = &build_clean($fieldname);


Then add the following codes in the &load_template hash:

Code:

fieldname => $clean_fieldname


of course, replace fieldname with the name of the field you've added....

Not that hard to figure out if you look at the out-of-box example of $category...Wink

Regards,

Eliot Lee
Quote Reply
Re: remove category underscore (new field) In reply to
Duh...ok, I should've figured that out! Thanks Eliot.....appreciate it.

Quote Reply
Re: remove category underscore (new field) In reply to
You're welcome.

Regards,

Eliot Lee