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);
31 FOR subfield IN node.childNodes;
32 NEXT UNLESS subfield.nodeName == "subfield";
33 code = subfield.getAttribute('code');
35 relcode = subfield.textContent.substr(0,3);
36 tlabel = relators.$relcode || label;
38 NEXT UNLESS code.match('[a-z]');
39 sf_raw = subfield.textContent;
40 sf = subfield.textContent | html;
41 term = term _ ' ' _ sf;
42 qterm = qterm _ ' ' _ sf_raw;
44 url = mkurl(ctx.opac_root _ '/results', {query => qterm, qtype => 'author'}, ['page', 'expand']);
45 author_type = (tlabel || label) | html;
49 iprop = ' itemprop="accountablePerson"';
50 ELSIF type == 'added';
51 iprop = ' itemprop="contributor"';
53 '<a href="' _ url _ '"' _ iprop _ '>' _ term.replace('^\s+', '') _ '</a> (' _ author_type _ '). ';
58 <div class='rdetail_authors_div'>
59 [%- FOREACH author IN authors;
60 NEXT UNLESS author.xpath;
61 links = PROCESS build_author_links(
62 xpath=author.xpath, label=author.label, type=author.type
64 IF links.match('\S') %]
65 <span class='rdetail-author-div'>[% links %]</span>