Gossamer Forum
Home : Products : DBMan : Customization :

Side By Side Entries

Quote Reply
Side By Side Entries
Is there a way to display your records side by side, not one row at a time?

Quote Reply
Re: Side By Side Entries In reply to
oh, and not using ssi's. Just editing the html.pl
Quote Reply
Re: Side By Side Entries In reply to
By side by side are you referring to the output of your database data within either
sub html_record { or sub html_record_long {?

You can format this html in any manner you wish. To display the information in say 2 columns you could do something like the following which is showing the contact information in one column and the company logo in another:


<TR><TD colspan=2> </TD></TR>
<TR><TD colspan=2><$font><B><A NAME=\"contact\">Contact Information:</A></B></font></TD></TR>
<TR><TD colspan=2><TABLE width=460 border=0><TR valign=top><TD width=260><$font>
Contact: $rec2{'UFirstName'} $rec2{'ULastName'} <BR>|;
if ($rec2{'UBusiness'}) { print qq|$rec2{'UBusiness'}<BR> |; }
if ($rec2{'RevealAdd'} eq "Yes") { print qq|$rec2{'UAddress'}<BR> |; }
if ($rec2{'RevealAdd'} eq "No") { print qq|<BR> |; }
print qq|
$rec2{'UCity'}, $rec2{'UState'} $rec2{'UZip'}<BR>
$rec2{'UCounty'} County<BR><BR>|;
if ($rec2{'RevealPhn'} eq "Yes") { print qq|<$font>Phone: $rec2{'UPhone'}</font><BR> |; }
if ($rec2{'RevealPhn'} eq "No") { print qq|<$font>Phone:</font><BR>|; }
if ($rec2{'UFax'}) { print qq|Fax: $rec2{'UFax'}<BR> |; }
print qq| </font></TD><TD width=200 align=center valign=top> |;
if ($rec{'RevealLogo'} eq "Yes") { print qq|<IMG SRC="$rec2{'UCoLogo'}"></A>|; }
print qq| </TD></TR></TABLE></TD></TR>
<TR><TD colspan=2> </TD></TR>

This would allow you to have the full screen width for some data and then have some information displayed in columns.

Notice the table within the table.

Hope this is what you were looking for and that it provides ideas Smile
Quote Reply
Re: Side By Side Entries In reply to
that does provide some great idea. I'm going to study the code more tonight, but from the looks of it, it does not look like exactly what i had in mind. I was just curious say, if i have record 1, and record 2, how to display both of them side by side. take a look at this example:

http://24.11.140.106/cgi-bin/streetracing/dss/db.cgi?db=default&uid=default&new_records=1
Quote Reply
Re: Side By Side Entries In reply to
I'm less clear on what you're looking for my checking that link Smile

I think you may be looking for the short/long display which would give you a limited amount of information and then link to the full display of the record?

If this is still not what you are looking for, please provide a text example and try to explain in more detail of what you are trying to accomplish.

I'm sorry, but I'm still not sure what you are wanting to do if it's not the short/long display.
Quote Reply
Re: Side By Side Entries In reply to
how's this.

http://24.11.140.106/db.htm

hope this helps.
Quote Reply
Re: Side By Side Entries In reply to
So you want a two-column display of your records?

Could you post your html.pl file in .txt form so I could take a look at it? It would be easier to figure out what you need.


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





Quote Reply
Re: Side By Side Entries In reply to
Here you go..

sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
# <table width="100%" border="1" cellspacing="0" cellpadding="2">

my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);

print qq|
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#000099">
<td>
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">$rec{'Title'} - $rec{'Date'}</font></div>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="133"><A HREF="$rec{'URL'}"><img src="$rec{'Image'}" border=2 alt="Click Here for $rec{'Title'}"></td>
<td width="86%" bgcolor="#0000CC">
<div align="center"><font color="#000000"><font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">$rec{'Description'}</font></div>
</td>
</tr>
</table>
|;
}
Quote Reply
Re: Side By Side Entries In reply to
No. I need you to save the whole file as a .txt file and put it on your site. Then let me know where I can see it. There's things you need to do to 2 different subroutines.


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





Quote Reply
Re: Side By Side Entries In reply to
It's located here:
http://24.11.140.106/html.txt


thanks
Quote Reply
Re: Side By Side Entries In reply to
Thanks, Ryan. (Sorry if I was a bit abrupt in my last post. Sometimes when I'm sleepy I get a little brusque.)

I just needed to be sure you hadn't made a lot of changes to sub html_view_success. You haven't. Smile

In sub html_view_success, instead of:

Code:
for (0 .. $numhits - 1) {
print "<P>";
&html_record (&array_to_hash($_, @hits));
}

use

Code:
print "<table>";
for (0 .. $numhits - 1) {
++$rec_count;
if ($rec_count%2) {
print "<tr>\n";
}
print "<td>";
&html_record (&array_to_hash($_, @hits));
print "</td>";
unless ($rec_count%2) {
print "</tr>\n";
}
}

# this section prints out a blank cell in case there are an odd number of records returned
unless ($rec_count%2) {
print "<td>&</td></tr>\n";
}
print "</table>";



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





Quote Reply
Re: Side By Side Entries In reply to
it works!

thanks again Smile

ryan
Quote Reply
Re: Side By Side Entries In reply to
Of course it does. You doubted me? Wink


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