Gossamer Forum
Home : Products : DBMan : Installation :

Search results - html_record

Quote Reply
Search results - html_record
Hi,

I see in may sites, when the search results comes up, it come up in rows. I know how to create the rows, that is not my question. My question is that sometimes every other row is for example gray. Meaning the search result will come up, the first row will be white, the second row will be gray, the third row will be white, and etc.. How can I do this. I think the problem here would be that since there is only one html_record, and it will continue to display the results only from that html_record.

Please tell me how I can do this

------------------
JFrost





Quote Reply
Re: Search results - html_record In reply to
You could have a counter in html_view_success to set the background color of a table (or row).

Code:
$i = 0;
for (0 .. $numhits - 1) {
if ($i%2 == 0) {
$bk_color = "#ffffff"; #white
}
else {
$bk_color = "#afafaf; #gray
}
print "<P>";
&html_record (&array_to_hash($_, @hits));
++$i;
}

Then in html_record use $bk_color where you would normally add the color for the table or row.


------------------
JPD


Quote Reply
Re: Search results - html_record In reply to
Hi,

First of all, I want to really thank you for taking your time and helping me out.

Now on to the problem. I have copied and pasted the exact code that you given me
Code:
|;
$i = 0;
for (0 .. $numhits - 1) {
if ($i%2 == 0) {
$bk_color = "#ffffff"; #white
}
else {
$bk_color = "#afafaf; #gray
}
print "<P>";
&html_record (&array_to_hash($_, @hits));
++$i;
}
print qq|
but I keep on getting the followig error message.

Error Message : Error loading required libraries. Check that they exist, permissions are set correctly and that they compile. Reason: syntax error at ./html.pl line 679, near "P>" (Might be a runaway multi-line "" string starting on line 677) Missing right bracket at ./html.pl line 1498, at end of line syntax error at ./html.pl line 1498, at EOF.

Do you know what this can be.

------------------
JFrost

[This message has been edited by JFrost (edited March 07, 1999).]
Quote Reply
Re: Search results - html_record In reply to
Looks like I left off a quote.

Code:
$i = 0;
for (0 .. $numhits - 1) {
if ($i%2 == 0) {
$bk_color = "#ffffff"; #white
}
else {
$bk_color = "#afafaf"; #gray
}
print "<P>";
&html_record (&array_to_hash($_, @hits));
++$i;
}


------------------
JPD