Gossamer Forum
Home : Products : Links 2.0 : Customization :

Categorys in two columns

Quote Reply
Categorys in two columns
I am using links2.0 with the set of templates -Script Resource Center Templates - as used on the gossamer-threads site - made by alex.

I am tring to change the category listings from 1 column to 2 columns.

I have added this to the site_html_templates.pl

# 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 class="catlist" valign="top">\n|;
}
$i++;

But I am still getting only 1 column, does anyone know what else has to be done to get 2 columns to display???


Question 2.

the Categorys are displayed like this..

Cat 1
Space
Cat 2
Space
Cat 3
etc

how can I get it to display like this..

Cat 1
Cat 2
Cat 3
etc

Thanks
Steve
Quote Reply
Re: [steve1234] Categorys in two columns In reply to
Steve,

The code you say you added should already have been in the script. Links builds two columns by default, as long as there are categories in the db.

Where you see this code, add the hash marks (#) to comment out that code, then it should build without spaces. Also, remove the parts in red.

Code:
# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<dl><dt><strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
$output .= qq|<small><sup class="new">new</sup></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>|;
}


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Categorys in two columns In reply to
Great - I must have had a copy of the code that had been modifyed to 1 column. I have changed the code back to the original... And I have 2 columns.
So that one is fixed [:)]

I made the recommended changes to get rid of the space between cat's... but I got the following result

Cat1 Cat2 Cat3 etc, all on one line...

So I change the code to...

# Then we print out the name linked, new if it's new, and popular if its popular.
$output .= qq|<strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;
$output .= qq|<small><sup class="new">new</sup></small>| if (&days_old($mod) < $db_new_cutoff);
$output .= qq|<br>|;
# $output .= qq|<dd><span class="descript">$description </span></dd>| if (!($description =~ /^[\s\n]*$/));
# $output .= qq|</dl>|;
}

This fixed it up to what I wanted...

Thanks for all the help'
Steve.