Fall back to leader for format_type and format_icon
authorJeff Godin <jgodin@tadl.org>
Thu, 4 Apr 2013 20:57:05 +0000 (16:57 -0400)
committerJeff Godin <jgodin@tadl.org>
Thu, 4 Apr 2013 20:57:05 +0000 (16:57 -0400)
Fall back to leader for format_type and format_icon.

Currently, format_type is just the single letter code.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
templates_tadlskin/opac/parts/misc_util.tt2

index faa1e02..a252df3 100644 (file)
             END;
         END;
 
+        IF !args.format_label AND !args.format_icon;
+            node = xml.findnodes(
+                '//*[local-name()="leader"]');
+            type = node.textContent.substr(6,1);
+            args.format_label = type;
+            args.format_icon = ctx.media_prefix _ '/images/format_icons/item_type/' _ type _ '.png';
+        END;
+
     END;
 %]