4 display_field => 'subject',
5 label => l('Subject: '),
6 xpath => '//*[@tag="600" or @tag="610" or @tag="611" or @tag="630" or @tag="650" or @tag="651"]'
9 facet => 'identifier|genre',
11 xpath => '//*[@tag="655"]',
12 subfields => '[abvxyz]'
14 label => l('Topic Heading: '),
15 xpath => '//*[@tag="690"]'
17 label => l('Geographic Setting: '),
18 xpath => '//*[@tag="691"]'
20 label => l('Biographical Subject: '),
21 xpath => '//*[@tag="692"]'
23 label => l('Character Attributes: '),
24 xpath => '//*[@tag="693"]'
26 label => l('Setting: '),
27 xpath => '//*[@tag="698"]'
29 label => l('Time Period: '),
30 xpath => '//*[@tag="699"]'
35 xpath = s.xpath || '//*[starts-with(@tag,"6")]';
36 FOR node IN ctx.marc_xml.findnodes(xpath);
37 '<span property="about">';
40 FOR subfield IN node.childNodes;
41 NEXT UNLESS subfield.nodeName == "subfield";
42 code = subfield.getAttribute('code');
44 linked_fields = [subfield.textContent()];
45 target_field = node.getAttribute('tag');
49 NEXT UNLESS code.match('[a-z]');
50 IF s.subfields; NEXT UNLESS code.match(s.subfields); END;
52 IF code.match('[vxyz]'); " > "; END;
54 # at this point, we actually have a partial term to use.
55 raw_term = subfield.textContent;
56 single_term = raw_term | html;
58 # facets should be used as-is
59 IF !s.facet; raw_term = raw_term.replace('\-', ' ').replace('[#"^$\+,:;&|\[\]()]', ''); END;
61 all_terms.push(raw_term);
64 total_term = s.facet _ '[' _ all_terms.join(s.joiner).replace('\s+$', '') _ ']';
66 total_term = all_terms.join(" ").replace('\s+$', '');
70 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))
71 -%]">[% single_term %]</a> [%-
74 IF all_terms.size; "<br/>"; END;
75 FOREACH link880 IN graphics;
76 '<div class="graphic880"' _ link880.dir _ '>';
84 BLOCK render_hl_subject;
85 '<span property="about">';
87 mkurl(ctx.opac_root _ '/results', {qtype=>'subject', query=>s.value}, stop_parms.merge(expert_search_parms, general_search_parms, browse_search_parms, facet_search_parms))
88 -%]">[% s.highlight %]</a> [%-
93 [% BLOCK render_all_subjects;
94 FOREACH subj IN subjects;
96 df = subj.display_field;
97 IF df AND attrs.hl_display_fields.$df.size;
99 FOREACH hl_s IN attrs.hl_display_fields.$df;
100 next_s = PROCESS render_hl_subject(s=hl_s);
101 content.push(next_s);
104 content = content.join('<br/>');
106 <table class='rdetail_subject'>
109 <td class='rdetail_subject_type'>[% subj.label %]</td>
110 <td class='rdetail_subject_value'>[% content %]</td>
116 content = PROCESS render_subject(s=subj);
117 IF content.match('\S');
119 <table class='rdetail_subject'>
122 <td class='rdetail_subject_type'>[% subj.label %]</td>
123 <td class='rdetail_subject_value'>[% content %]</td>
132 [%- subject_html = PROCESS render_all_subjects;
133 IF subject_html.length > 0;
135 <h2 class='rdetail_related_subjects'>[% l('Search for related items by subject') %]</h2>