Gossamer Forum
Home : Products : Links 2.0 : Customization :

Rows in categories.

Quote Reply
Rows in categories.
Is there a way i could put each category in rows. for example if the colum #1 has 5 links in it. i want all of them to be placed in row. so there would be 5 rows in that colum. i also want to be able to change the bg color of those rows which i think involves html. i can handle the html part but i really need help getting the rows installed first. thanks.
Quote Reply
Re: Rows in categories. In reply to
yea.... but you would have to change the code.. that's all.. just make it like..

if ($i == <columns that you want> ) {
$output .= qq~</tr><tr>~;
$i=0;
}

and then for each category you would put it inside of <td></td>

that's all..
Quote Reply
Re: Rows in categories. In reply to
i dont understand what you mean by " for each category" there is no way i can can see the categories in the site_html_templates.pl . could you give me the excat source.
Quote Reply
Re: Rows in categories. In reply to
all in site_html_templates.pl sub (site_html_print_cat)

change
Code:
$output = qq|<div class="margin"><table width="80%" border="0" cellspacing="0" cellpadding="0"><tr><td class="catlist" valign="top">\n|;

to
Code:
$output = qq|<div class="margin"><table width="80%" border="0" cellspacing="0" cellpadding="0">\n|;

change
Code:
if ($i == $half) {
$output .= qq|</td><td class="catlist" valign="top">\n|;
}

to
Code:
if ($i == 3) {
$output .= qq|</tr><tr>\n|;
$i = 0;
}
change the 3 to how many COLUMNS you want..

change:
Code:
$output .= qq|<dl><dt><strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;

to

Code:
$output .= qq|<td><dl><dt><strong><a class="link" href="$url">$category_name</a></strong> <small class="numlinks">($numlinks)</small> |;

change:
Code:
$output .= qq|</dl>|;

to
Code:
$output .= qq|</dl></td>|;

change
Code:
$output .= "</td></tr></table></div>\n";

to
Code:
$output .= "</table></div>\n";

[This message has been edited by widgetz (edited September 11, 1999).]
Quote Reply
Re: Rows in categories. In reply to
you are amazing! it worked!!!!!!!! thank you!!!!!
Quote Reply
Re: Rows in categories. In reply to
its perfect now but seems like i still need to know how to change the bg color of the rows. ( i dont mean to change the bg color of the whole table because then if i set cellspacing="2" cellpadding="2" i wouldnt be able to see the rows separtly. so all i need to know is how to change the "BGCOLOR" of the rows. ( cells ). thank you.
Quote Reply
Re: Rows in categories. In reply to
hmm.. ok.. i would think it would go in here:

Code:
if ($i == 3) {
$output .= qq|</tr><tr>\n|;
$i = 0;
}

try changing it to:

Code:
$color1 = "#ffffff";
$color2 = "#eeeeee";

if ($i == 3) {
($bgcolor eq $color1) ? $bgcolor = $color2 : $bgcolor = $color1;
$output .= qq|</tr><tr bgcolor="$bgcolor">\n|;
$i = 0;
}
Quote Reply
Re: Rows in categories. In reply to
I used this set up in order to make the directory look similar to Cgi-Resources
set up (each row has different color)
But it did not work! All the categories get a
background color but the top 2 categories do not get any background color!

Quote Reply
Re: Rows in categories. In reply to
If you have only two columns of categories, then you need to change the following codes:

Code:
if ($i == 3) {

to the following:

Code:
if ($i == 2) {

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: Rows in categories. In reply to
I changed it to 2 and I have two columns
but the 2 top categories do not have background!
ie.

Web hosting Designing

CGI scripts Java Scripts

Web services Domain names

CGI Books Buy Domains


all categories have background color.
But the top two "Webhosting and Designing"
has white background (no color) Why?