Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

site_html_print_cat splitting columns wrong

Quote Reply
site_html_print_cat splitting columns wrong
I've been trying to get my categories to look the same between Links 2 and Links SQL. The spacing has been somewhat different, and I think I see why. Looking at the source code, I am getting this sort of a structure for category and subcategory columns:

<table>
<tr><td>
</td><td>
<td>column 1</td>
<td>column 2</td></tr>
</table>

I'm pretty sure the problem is arising in site_html_print_cat in HTML_Templates.pm at this line:

# 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).
($i and ($i % $breakpoint)) or ($output .= qq|</td><td valign="top">\n|);

As far as I can tell, that's where the extra column is being inserted, but I'm not quite sure why or how to change it to rectify this.

I have the following set in Links.pm:

# Number of columns to display a list of categories.
$LINKS{build_category_columns} = 2;

Am I missing something, or is there an error in the column calculation?

Thanks,
Dan
Quote Reply
Re: site_html_print_cat splitting columns wrong In reply to
Dan,

You have the right subroutine. Try this.

# 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 ($i == 0){} #added
else { ($i and ($i % $breakpoint)) or ($output .= qq|</td><td $LINKS{build_category_cell} >\n|);} #
$i++;

There's another method that I think also worked that was posted in the forum. I'd search do a search on "stop this table cell" or something else from the subroutine code.


Peace.

Kyle
Quote Reply
Re: site_html_print_cat splitting columns wrong In reply to
Kyle,

Ah yes, I remember seeing that discussion. Sorry for adding clutter to the forum... For those that are wondering, here it is:

http://www.gossamer-threads.com/...um9/HTML/000679.html

I used the code in the second post in the thread, and it works just fine. Combining that with the "compress white space" option in Links.pm looks to have spacing the way I want. Is there any drawback to compressing the output, such as running consecutive JavaScripts together?

Thanks,
Dan
Quote Reply
Re: site_html_print_cat splitting columns wrong In reply to
Found the same bug, finally, and a fix:

http://gossamer-threads.com/...sc&Number=111799

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://postcards.com/FAQ