- a library select pulldown menu on the OPAC masthead.
-
- 'Display this HTML when no results are found for a search in the OPAC:'
+ - '<br />Note: You can insert placeholders {QUERY_KW} that will be replaced with the keywords of the query.'
- pref: OPACNoResultsFound
type: textarea
class: code
}
# no hits
else {
+ my $nohits = C4::Context->preference('OPACNoResultsFound');
+ if ($nohits and $nohits=~/{QUERY_KW}/){
+ # extracting keywords in case of relaunching search
+ (my $query_kw=$query_desc)=~s/ and|or / /g;
+ $query_kw = Encode::decode_utf8($query_kw);
+ my @query_kw=($query_kw=~ /([-\w]+\b)(?:[^,:]|$)/g);
+ $query_kw=join('+',@query_kw);
+ $nohits=~s/{QUERY_KW}/$query_kw/g;
+ $template->param('OPACNoResultsFound' =>$nohits);
+ }
$template->param(
searchdesc => 1,
query_desc => $query_desc,