color: [% css_colors.text_badnews %];
padding: 10px;
}
+
+.custom_thumbnail_container {
+ margin: 20px auto;
+ text-align: center;
+ width: 90%;
+ min-height: 200px;
+ overflow: auto;
+ display: inline-block;
+}
+
+a.custom_thumbnail {
+ margin: 0px 20px;
+ text-align: center;
+ display: inline-block;
+ text-decoration: none;
+ color: black;
+}
+
+img.custom_thumbnail {
+ max-height: 150px;
+ max-width: 150px;
+}
+
+.custom_thumbnail_caption {
+ text-align: center;
+ color: black;
+ font-weight: bold;
+}
[%- END %]
[%- END %]
[%- merged_uris = args.uris.merge(args.online_res);
+file_ext_re = '\.(?i:jpe?g|png|bmp|gif|tif|psd|thm|yuv)$';
+
+thumbnails = [];
+
+FOR uri_field IN attrs.marc_xml.findnodes('//*[@tag="956"]');
+ tn = {};
+
+ x = uri_field.findnodes('./*[@code="t"]/text()');
+ FOR i IN x;
+ tn.thumb = i.textContent;
+ END;
+
+ x = uri_field.findnodes('./*[@code="u"]/text()');
+ FOR i IN x;
+ tn.target = i.textContent;
+ END;
+
+ x = uri_field.findnodes('./*[@code="c"]/text()');
+ FOR i IN x;
+ tn.caption = i.textContent;
+ END;
+
+ IF tn.target.length > 0;
+ IF !tn.caption;
+ tn.caption = '';
+ END;
+ IF !tn.thumb AND tn.target.match(file_ext_re);
+ tn.thumb = tn.target;
+ END;
+ thumbnails.push(tn);
+ END;
+END;
+
+-%]
+
+<div class="custom_thumbnail_container">
+ [%- FOR tn IN thumbnails %]
+ <a class="custom_thumbnail"
+ href="[% tn.target %]">
+ <img class="custom_thumbnail" src="[% tn.thumb %]" alt="[% tn.caption | html %]"/>
+ <div class="custom_thumbnail_caption">[% tn.caption %]</div>
+ </a>
+ [%- END %]
+</div>
num_uris = merged_uris.size;
IF num_uris > 0;
-%]