Hi
I set up a searchable database about a year ago using JPDeni's great advice and all has run well. Now I have a problem that I can't seem to solve. Any advice will be much appreciated.
The last field displayed on my results page is a url. Up to now the lenghth of this has not been a problem but due to changing circumstances the url can be up to 400 characters and completely messes up the displayed results.
I believe this can be solved by in html_record but can't work out quite how. The field I want to shorten the display of is 'J'. Here's my script for html_record:
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.
my (%rec) = @_; # Load any defaults to put in the VALUE field.
my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';
$url{'J'} = $rec{'J'};
$url{'J'} =~ s/<\/?B>//g;
# Replace FieldName below with the names of the fields you want to display. Create as many table cells as you wish, one for each field.
print qq|
<TD BORDER=1 BGCOLOR="#FFFFCC"> <$font>$rec{'B'}</Font></TD><TD BORDER=1 BGCOLOR="#FFFFCC"> <$font>$rec{'E'}</Font></TD>
<TD BORDER=1 BGCOLOR="#FFFFCC"> <$font>$rec{'F'}</Font></TD><TD BORDER=1 BGCOLOR="#FFFFCC"> <$font>$rec{'G'}</Font></TD>
<TD BORDER=1 BGCOLOR="#FFFFCC"> <$font>$rec{'H'}</Font></TD><TD BORDER=1 BGCOLOR="#FFFFCC"> <$font><a href="$url{'J'}">$rec{'J'}</TD> |;
}
Thanks in advance.
Andy
I set up a searchable database about a year ago using JPDeni's great advice and all has run well. Now I have a problem that I can't seem to solve. Any advice will be much appreciated.
The last field displayed on my results page is a url. Up to now the lenghth of this has not been a problem but due to changing circumstances the url can be up to 400 characters and completely messes up the displayed results.
I believe this can be solved by in html_record but can't work out quite how. The field I want to shorten the display of is 'J'. Here's my script for html_record:
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.
my (%rec) = @_; # Load any defaults to put in the VALUE field.
my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';
$url{'J'} = $rec{'J'};
$url{'J'} =~ s/<\/?B>//g;
# Replace FieldName below with the names of the fields you want to display. Create as many table cells as you wish, one for each field.
print qq|
<TD BORDER=1 BGCOLOR="#FFFFCC"> <$font>$rec{'B'}</Font></TD><TD BORDER=1 BGCOLOR="#FFFFCC"> <$font>$rec{'E'}</Font></TD>
<TD BORDER=1 BGCOLOR="#FFFFCC"> <$font>$rec{'F'}</Font></TD><TD BORDER=1 BGCOLOR="#FFFFCC"> <$font>$rec{'G'}</Font></TD>
<TD BORDER=1 BGCOLOR="#FFFFCC"> <$font>$rec{'H'}</Font></TD><TD BORDER=1 BGCOLOR="#FFFFCC"> <$font><a href="$url{'J'}">$rec{'J'}</TD> |;
}
Thanks in advance.
Andy