args.display_fields = {};
args.hl = {};
- IF !CGI.param('no_highlight') && !search.no_highlight;
-
- args.display_field_list = ctx.fetch_display_fields(args.df_bib_list.list);
-
- junk = ctx.timelog('Mapping highlighted display fields for bib(s) ' _ args.df_bib_list.list.join(', '));
- FOR df IN args.display_field_list;
- df_map = ctx.search_cdfm('field', df.field).0;
- df_name = df_map.name();
- IF df_map.multi() == 't';
- IF NOT args.hl_display_fields.$df_name;
- args.hl_display_fields.$df_name = [];
- args.hl.$df_name = [];
- END;
- args.hl_display_fields.$df_name.push(df);
- args.hl.$df_name.push(df.highlight || df.value);
- ELSIF !args.hl_display_fields.$df_name.defined;
- args.hl_display_fields.$df_name = df;
- args.hl.$df_name = df.highlight || df.value;
+
+ args.hl_field = 'highlight';
+ IF CGI.param('no_highlight') || search.no_highlight;
+ args.hl_field = 'value';
+ END;
+ hl_field = args.hl_field;
+
+ junk = ctx.timelog('Fetching display fields and Using data from "' _ hl_field _ '" for rendering');
+ args.display_field_list = ctx.fetch_display_fields(args.df_bib_list.list);
+
+ junk = ctx.timelog('Mapping display fields for bib(s) ' _ args.df_bib_list.list.join(', '));
+ FOR df IN args.display_field_list;
+ df_map = ctx.search_cdfm('field', df.field).0;
+ df_name = df_map.name();
+ IF df_map.multi() == 't';
+ IF NOT args.hl_display_fields.$df_name;
+ args.hl_display_fields.$df_name = [];
+ args.hl.$df_name = [];
END;
+ args.hl_display_fields.$df_name.push(df);
+ args.hl.$df_name.push(df.$hl_field || df.value);
+ ELSIF !args.hl_display_fields.$df_name.defined;
+ args.hl_display_fields.$df_name = df;
+ args.hl.$df_name = df.$hl_field || df.value;
END;
- junk = ctx.timelog('Finished mapping highlighted display fields for bib(s) ' _ args.df_bib_list.list.join(', '));
END;
+ junk = ctx.timelog('Finished mapping display fields for bib(s) ' _ args.df_bib_list.list.join(', '));
# Map item types to schema.org types; impedance mismatch :(
args.schema.itemtype = {};
BLOCK render_series;
results = [];
IF attrs.hl_display_fields.series_title.size;
+ hl_field = attrs.hl_field;
FOREACH s IN attrs.hl_display_fields.series_title;
search_term = s.value.replace('[#"^$\+\-,\.:;&|\[\]()]', ' ').replace('\s+$', '') | html;
url = mkurl(ctx.opac_root _ '/results',
{ qtype=>'series', query=>search_term }, stop_parms.merge(expert_search_parms, general_search_parms, browse_search_parms, facet_search_parms)
);
- series = '<a href="' _ url _ '">' _ s.highlight _ '</a> ';
+ series = '<a href="' _ url _ '">' _ s.$hl_field _ '</a> ';
results.push(series);
END;
ELSE;
'<span property="about"><!-- highlighted -->';
%]<a href="[%-
mkurl(ctx.opac_root _ '/results', {qtype=>'subject', query=>total_term}, stop_parms.merge(expert_search_parms, general_search_parms, browse_search_parms, facet_search_parms))
- -%]">[% s.highlight %]</a> [%-
+ -%]">[% s.$f %]</a> [%-
'</span>';
END;
%]
content = [];
FOREACH hl_s IN attrs.hl_display_fields.$df;
hl_s.facet = subj.facet;
- next_s = PROCESS render_hl_subject(s=hl_s);
+ next_s = PROCESS render_hl_subject(s=hl_s,f=attrs.hl_field);
content.push(next_s);
END;