3 PROCESS "opac/parts/relators.tt2";
9 xpath => '//*[@tag="100"]|//*[@tag="110"]|//*[@tag="111"]'
12 label => l('Added Author'),
13 xpath => '//*[@tag="700"]|//*[@tag="710"]|//*[@tag="711"]'
17 xpath => '//*[@tag="508"]'
20 label => l('Author Notes: '),
21 xpath => '' # Comes from added content...
25 BLOCK build_author_links;
26 FOR node IN ctx.marc_xml.findnodes(xpath);
32 FOR subfield IN node.childNodes;
33 NEXT UNLESS subfield.nodeName == "subfield";
34 code = subfield.getAttribute('code');
36 relcode = subfield.textContent.substr(0,3);
37 tlabel = relators.$relcode || label;
40 linked_fields = [subfield.textContent()];
41 target_field = node.getAttribute('tag');
44 NEXT UNLESS code.match('[a-z]');
45 sf = subfield.textContent | html;
46 term = term _ ' ' _ sf;
47 IF code.match('[acdq]');
48 sf_raw = subfield.textContent.replace('[#"^$\+\-,\.:;&|\[\]()]', ' ');
49 qterm = qterm _ ' ' _ sf_raw;
52 url = mkurl(ctx.opac_root _ '/results', {query => qterm, qtype => 'author'}, ['page', 'expand']);
53 author_type = (tlabel || label) | html;
57 iprop = ' itemprop="accountablePerson"';
58 ELSIF type == 'added';
59 iprop = ' itemprop="contributor"';
61 '<a href="' _ url _ '"' _ iprop _ '>' _ term.replace('^\s+', '') _ '</a>';
62 FOREACH link880 IN graphics;
65 diratt = ' dir="' _ link880.dir _ '"';
67 ' <span class="graphic880"' _ diratt _ '>';
71 ' (' _ author_type _ '). ';
76 <div class='rdetail_authors_div'>
77 [%- FOREACH author IN authors;
78 NEXT UNLESS author.xpath;
79 links = PROCESS build_author_links(
80 xpath=author.xpath, label=author.label, type=author.type
82 IF links.match('\S') %]
83 <span class='rdetail-author-div'>[% links %]</span>