Gossamer Forum
Home : Products : DBMan : Customization :

Need help with long/short display !

Quote Reply
Need help with long/short display !
Hi, all!

When people search my database they are first taken to a results page with a few database fields, and can then click a link to see the full record.

This is my code :

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.
# This is the "short display" -- the list of records that are returned
# from a search.

my (%rec) = @_;

# create link to full display
$record_number = ((($nh - 1) * $db_max_hits) + $i);

$long_url = $ENV{'QUERY_STRING'};
$long_url =~ s/\&nh=\d+//;
$long_url =~ s/\&mh=\d+//;

$long_url = "$db_script_url?$long_url&nh=$record_number&mh=1";

print qq!

$rec{'Title'}

$rec{'Header'}

<small>posted on $rec{'Date'}
<a href="$long_url"><b>more details</b></a>
</small>
!;

My problem is that the $long_url contains only the fields actually used in the search. I need some additional info in this string. My long display contains this code :

print qq| Meet the editor of this category |if ($in{'Category'} eq "Music");

Unless the visitors search in the ($rec{'Category'} field the $long_url won't contain &Category=query and hence the if statement won't return anything. Hope this was understandeable!

Best, Stian