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"]'
8 display_field => 'genre',
10 facet => 'identifier|genre',
12 xpath => '//*[@tag="655"]',
13 subfields => '[abvxyz]'
15 label => l('Topic Heading: '),
16 xpath => '//*[@tag="690"]'
18 label => l('Geographic Setting: '),
19 xpath => '//*[@tag="691"]'
21 label => l('Biographical Subject: '),
22 xpath => '//*[@tag="692"]'
24 label => l('Character Attributes: '),
25 xpath => '//*[@tag="693"]'
27 label => l('Setting: '),
28 xpath => '//*[@tag="698"]'
30 label => l('Time Period: '),
31 xpath => '//*[@tag="699"]'
36 xpath = s.xpath || '//*[starts-with(@tag,"6")]';
37 FOR node IN ctx.marc_xml.findnodes(xpath);
38 '<span property="about">';
41 FOR subfield IN node.childNodes;
42 NEXT UNLESS subfield.nodeName == "subfield";
43 code = subfield.getAttribute('code');
45 linked_fields = [subfield.textContent()];
46 target_field = node.getAttribute('tag');
50 NEXT UNLESS code.match('[a-z]');
51 IF s.subfields; NEXT UNLESS code.match(s.subfields); END;
53 IF code.match('[vxyz]'); " > "; END;
55 # at this point, we actually have a partial term to use.
56 raw_term = subfield.textContent;
57 single_term = raw_term | html;
59 # facets should be used as-is
60 IF !s.facet; raw_term = raw_term.replace('\-', ' ').replace('[#"^$\+,:;&|\[\]()]', ''); END;
62 all_terms.push(raw_term);
65 total_term = s.facet _ '[' _ all_terms.join(s.joiner).replace('\s+$', '') _ ']';
67 total_term = all_terms.join(" ").replace('\s+$', '');
71 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))
72 -%]">[% single_term %]</a> [%-
75 IF all_terms.size; "<br/>"; END;
76 FOREACH link880 IN graphics;
77 '<div class="graphic880"' _ link880.dir _ '>';
85 BLOCK render_hl_subject;
88 total_term = s.facet _ '[' _ s.value _ ']';
91 '<span property="about"><!-- highlighted -->';
93 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))
94 -%]">[% s.$f %]</a> [%-
99 [% BLOCK render_all_subjects;
100 FOREACH subj IN subjects;
102 df = subj.display_field;
103 IF df AND attrs.hl_display_fields.$df.size;
105 FOREACH hl_s IN attrs.hl_display_fields.$df;
106 hl_s.facet = subj.facet;
107 next_s = PROCESS render_hl_subject(s=hl_s,f=attrs.hl_field);
108 content.push(next_s);
111 content = content.join('<br/>');
113 <table class='rdetail_subject'>
116 <td class='rdetail_subject_type'>[% subj.label %]</td>
117 <td class='rdetail_subject_value'>[% content %]</td>
123 content = PROCESS render_subject(s=subj);
124 IF content.match('\S');
126 <table class='rdetail_subject'>
129 <td class='rdetail_subject_type'>[% subj.label %]</td>
130 <td class='rdetail_subject_value'>[% content %]</td>
139 [%- subject_html = PROCESS render_all_subjects;
140 IF subject_html.length > 0;
142 <h2 class='rdetail_related_subjects'>[% l('Search for related items by subject') %]</h2>