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
Quote Reply
Re: [valiant] Modifying SiteHTML.pm In reply to
Hi Valiant,

Before you change the code you may want to try the following if you haven't already.

With the YahooSubcats Plugin you can change how many subcats are displayed or how many characters.

Admin>Plugins>YahooSubcats>Edit

If that does not suit you can modify the subcategory.html template and set a height for the table and or cell property.

Regards

minesite
Quote Reply
Re: [valiant] Modifying SiteHTML.pm In reply to
Also, you can modify the "build_category_table" field in the admin console under Setup>Build Options.

Sean