Gossamer Forum
Home : Products : Links 2.0 : Customization :

Why only one column not two

Quote Reply
Why only one column not two
Hi

I am using the Gossamer Threads template for LINKS2 on my website, but I only get one column not two in the categories, I HAVE conducted an extenisive search of the forums but can't figure out the reason, can anyone help?

See my site at

www.brighton-today.com/Links

Here is the relevent section of site_html_template

sub site_html_print_cat {
# --------------------------------------------------------
# This routine determines how the list of categories will look.
# We now use a table to split the category name up into two columns.
# For each category you can use the following variables:
#
# $url : The URL to go to that category
# $category_name : The category name with _ and / removed.
# $category_descriptions{$subcat}: The category description (if any).
# $numlinks : The number of links inside that category (and subcategories).
# $mod : The newest link inside of that category.
#

my (@subcat) = @_;
my ($url, $numlinks, $mod, $subcat, $category_name, $description, $output, $i);
my ($half) = int (($#subcat+2) / 2);

$output = qq|<tr><td width="50%">|;
foreach $subcat (sort @subcat) {
($description) = @{$category{$subcat}}[2];

# First let's get the name, number of links, and last modified date...
$url = "$build_root_url/" . &urlencode($subcat) . "/";
if ($subcat =~ m,.*/([^/]+)$,) { $category_name = &build_clean($1); } else { $category_name = &build_clean($subcat); }
$numlinks = $stats{"$subcat"}[0];
$mod = $stats{"$subcat"}[1];

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<tr><td><font face="Verdana, Helevtica, Arial" size=2><dl><dt><strong><a href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
$output .= qq|<small><font color="red">new</font></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|</dt>|;
$output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
$output .= qq|</dl></font></td></tr>|;
}

return $output;
}

sub site_html_review_form {
my %rec = @_;
&get_reviews ($rec{'ID'});

&html_print_headers;
print &load_template ('review_form.html', {
reviews => $reviews,
results => $review_results,
review_graph => $review_graph,
ratings => $ratings,
average => $average,
highest => $highest,
lowest => $lowest,
displayed1 => $displayed1,
displayed2 => $displayed2,
span => $span,
page => $page,
totalpages => $totalpages,
build_review_url => $build_review_url,
link_info => &site_html_link (%rec),
%rec,
%globals
});
}

sub site_html_review {
my (%tmp) = @_;

return &load_template ('review.html', {
%tmp,
%globals
});

}

sub site_html_review_success {
# --------------------------------------------------------

Thanks in advance for the help

Quote Reply
Re: Why only one column not two In reply to
I would recommend taking the original sub html_print_cat from your originial site_html_templates.pl file and putting it into your current site_html_templates.pl file.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Why only one column not two In reply to
Hi Elliot

Thanks for the suggestions, I tried this but it didn't work. Not sure if this will help, but here is the relevent section from my categories template file

<!-- Top Navigation bar -->
<body bgcolor="#8080FF" text="#000000" link="#003399" vlink="#8080FF" alink="#8080FF">
<center><table border=0 bgcolor="#C0C0C0" width=95% cellspacing="0" cellpadding="5"><tr><td bgcolor="#000080"><font face="Verdana, Helevetica, Arial" size=2><b><font color="#FFFFFF"><%title_linked%></font></b></font></td></tr><tr><td bgcolor="#8080FF"> </td></tr></table></center>


<!-- Category listings -->
<%if category%>
<center>
<table border=0 width=95% bgcolor=#000000><tr><td>
<table border=0 width=100% bgcolor=#FFFFFF cellspacing=1 cellpadding=4>
<tr><td bgcolor="#000080"><font face="Verdana, Helvetica" size=3 color="#FFFFFF"><b>Categories in <%category_clean%></b></font></td></tr>
<tr><td bgcolor="#F7F7F7"><font face="Verdana, Helvetica, Arial" size=2>
<%category%>

</font></tr>
</table>
</td></tr></table>
</center>
<%endif%>

<!-- Links listings -->
<%if links%>
<center>
<table border=0 width=95% bgcolor=#000000><tr><td bgcolor="#000080">
<table border=0 width=100% bgcolor=#FFFFFF cellspacing=1 cellpadding=4>
<tr><td bgcolor="#000080"><font face="Verdana, Helvetica" size="3" color="#FFFFFF"><b>Items
in <%category_clean%></b></font></td></tr>
<tr><td bgcolor="#F7F7F7"><font face="Verdana, Helvetica, Arial" size=2>
<%links%>

</font></tr>
</table>
</td></tr></table>
</center>
<%endif%>

<!-- Next/Prev toolbar -->
<p align=center>
<font face="Verdana">
<%if prev%>
<small><a href="<%prev%>">Prev <%build_links_per_page%></a></small>
<%endif%>
<%if next%>
<small><a href="<%next%>">Next <%build_links_per_page%></a></small>
<%endif%>
</font>
</p>

<!-- Related Categories -->
<%if related%>
<center>
<table border=0 width=95% bgcolor=#000000><tr><td>
<table border=0 width=100% bgcolor=#FFFFFF cellspacing=1 cellpadding=4>
<tr><td bgcolor="#000080"><font face="Verdana, Helvetica" size=3 color="#FFFFFF"><b>Related Topics</b></font></td></tr>
<tr><td bgcolor="#F7F7F7"><font face="Verdana, Helvetica, Arial" size=2>
<ul><%related%></ul>
</font></tr>
</table>
</td></tr></table>
</center>
<%endif%>

<%include footer.txt%>


Thanks

Rob

Quote Reply
Re: Why only one column not two In reply to
Well, in hacking the scripts, you have deleted the following codes in the sub site_html_print_cat routine, which causes the tables to be into columns:

Code:
# 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 == $half) {
$output .= qq|</td><td valign="top" width="50%">\n|;
}
$i++;

That is why you do not have two columns...As I mentioned before if you use the original sub mentioned above, IT WILL WORK!!!!

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Why only one column not two In reply to
Thanks, that sorted the columns problem

Strangely they are not evenly spaced and looking at the code I can't see why.

Any suggestions , check it out at

http://www.brighton-today.com/Links


Thanks in advance

Rob
Quote Reply
Re: Why only one column not two In reply to
 
Quote:
Strangely they are not evenly spaced and looking at the code I can't see why.

As stated MANY TIMES in this forum...you need to add a width attribute to your <td> codes in this sub.

Add width="50%" in the <td> codes in the $half codes I already provided you.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.