--- /dev/null
+[%-
+titles = [
+ {
+ label => l('Abbreviated title: '),
+ xpath => '//*[@tag="210" and @ind1="1"]'
+ }, {
+ label => l('Alternate title: '),
+ xpath => '//*[@tag="246" and @ind1="1"]'
+ },
+];
+
+BLOCK render_titles;
+ xpath = xpath || '//*[starts-with(@tag,"2")]';
+ FOR node IN ctx.marc_xml.findnodes(xpath);
+ all_content = [];
+ FOR subfield IN node.childNodes;
+ NEXT UNLESS subfield.nodeName == "subfield";
+ code = subfield.getAttribute('code');
+ NEXT UNLESS code.match('[a-z]');
+ all_content.push(subfield.textContent);
+ total_contents = all_content.join(" ").replace('\s+$', '');
+ %] [% total_contents %][%- END;
+ IF all_content.size; "<br/>"; END;
+ END;
+END
+%]
+[% BLOCK render_all_titles;
+ FOREACH title IN titles;
+ content = PROCESS render_titles(xpath=title.xpath);
+ IF content.match('\S');
+-%]
+<tr>
+ <td class='rdetail_content_type'>[% title.label %]</td>
+ <td class='rdetail_content_value' itemprop='keywords'>[% content %]</td>
+</tr>
+ [%- END; %]
+ [%- END; %]
+[%- END %]
+
+[%- title_html = PROCESS render_all_titles;
+ IF title_html.length > 0;
+%]
+<h2 class='rdetail_titles'>[% l('Other titles') %]</h2>
+<table class='rdetail_title rdetail_content'>
+ <tbody>
+[%- title_html %]
+ </tbody>
+</table>
+[%- END %]