Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Modifying SiteHTML.pm

Quote Reply
Modifying SiteHTML.pm
My site currently has 21 main categories in two columns, with the Yahoo subcats plugin listing the subcats underneath.

At present, the first few categories have more subcats than the remainder, which means that the columns are of uneven length.

What I would like to do is to insert the column break after the first 10 categories.

I have seen from other threads that the code I need to change is in SiteHTML.pm under the routine sub site_html_print_cat.

As far as I can tell, with my limited understanding of Perl, the following routine is what requires amending:

*******************
# We check to see if we are half way through, if so we stop this table cell
# and begin a new one (this lets us have category names in two columns).
if ($CFG->{build_category_columns}) {
($i > 0) and !($i % $breakpoint) and ($output .= qq|</td>\n<td valign="top" width="$width%" class="catlist">\n|);
$i++;
}
$output .= Links::user_page ('subcategory.html', $cat_r, $opts);
}

*******************

Which refers to $breakpoint, which is as follows:

*******************

my $breakpoint = int (($#{$subcat}+1) / $CFG->{build_category_columns}) + ( (($#{$subcat}+1) % $CFG->{build_category_columns}) ? 1 : 0);

*******************

Can this be changed easily, and if so, how?

Thanks in advance!

Valiant
Subject Author Views Date
Thread Modifying SiteHTML.pm valiant 1772 Apr 20, 2002, 6:22 AM
Post Re: [valiant] Modifying SiteHTML.pm
minesite 1666 Apr 20, 2002, 2:53 PM
Post Re: [valiant] Modifying SiteHTML.pm
SeanP 1660 Apr 20, 2002, 4:28 PM