END;
# "mattype" == "custom marc format specifier"
- icon_style = ctx.get_cgf('opac.icon_attr').value || 'item_type';
- formats_xpath = '//*[local-name()="attributes"]/*[local-name()="field"][@name="' _ icon_style _ '"]';
-
- args.all_formats = [];
- FOR node IN xml.findnodes(formats_xpath);
- IF node AND node.textContent;
- ccvm = ctx.get_ccvm(node.getAttribute('cvmid'));
- NEXT IF ccvm.opac_visible == 'f';
-
- format = {};
- type = ccvm.code.remove('-'); # blu-ray to bluray
- format.label = ccvm.search_label || ccvm.value;
- format.icon = PROCESS get_ccvm_icon ccvm=ccvm;
- format.itemtype = schema_typemap.$type || 'CreativeWork';
-
- args.all_formats.push(format); # metarecords want all formats
-
- IF !args.format_label;
- # use the first format as the default
- args.format_label = format.label;
- args.schema.itemtype = format.itemtype;
- args.format_icon = format.icon;
+ icon_styles = ctx.get_cgf('opac.icon_attr').value || 'item_type';
+ FOREACH icon_style IN icon_styles.split(',');
+ formats_xpath = '//*[local-name()="attributes"]/*[local-name()="field"][@name="' _ icon_style _ '"]';
+
+ args.all_formats = [];
+ FOR node IN xml.findnodes(formats_xpath);
+ IF node AND node.textContent;
+ ccvm = ctx.get_ccvm(node.getAttribute('cvmid'));
+ NEXT IF ccvm.opac_visible == 'f';
+
+ format = {};
+ type = ccvm.code.remove('-'); # blu-ray to bluray
+ format.label = ccvm.search_label || ccvm.value;
+ format.icon = PROCESS get_ccvm_icon ccvm=ccvm;
+ format.itemtype = schema_typemap.$type || 'CreativeWork';
+
+ args.all_formats.push(format); # metarecords want all formats
+
+ IF !args.format_label;
+ # use the first format as the default
+ args.format_label = format.label;
+ args.schema.itemtype = format.itemtype;
+ args.format_icon = format.icon;
+ END;
END;
END;
+ LAST IF args.all_formats.size > 0;
END;
args.bibid = [];