Fallback thumbnail for an XML file


I'm using Omeka to host some hitherto unpublished documents in a collection (the documents are scholarly articles, texts of conference papers, etc.)

I've created an item for each document. Attached to each item is two files: a PDF of the document, as well as an XML version of it. The XML is actually what the PDF was created from, and is in TEI-compliant markup.

The PDF file has a thumbnail of its first page generated and this thumbnail is displayed on the item page for the document - so far, so good.

The XML file does not have a thumbnail and instead a text link is shown.

Is it possible to tell Omeka to display a fallback thumbnail instead of the text link, and if possible a fallback thumbnail I've created myself which shows it is an XML file?

I've been trying to get a result using the options for the files_for_items call in show.php, but no joy so far. These options are:

'icons' => array('audio/mpeg'=>img('audio.gif'))));

My idea has been to use the icons option to call an image for text/xml files, but I can't figure out where to place the image (in the example above audio.gif) - if I use an absolute URL I get an error.

Omeka version is 2.2 and theme is Emiglio.

Many thanks for any assistance!

This appears to be a bug in Emiglio, actually. On the admin side, or with a different theme, do you get a fallback image?

Hi Patrick, it does indeed show up on the admin side of things as a thumbnail.

As an alternative, is there anyway to control the text link to perhaps say 'XML' rather than give the filename? At the moment I am telling Omeka to import the files from another website on the web (one I own and that this Omeka installation is to replace), so it gives the text link as the full URL from where it got the file - which looks a bit ugly!


Ugly, indeed!

When I added this to the icons array, it worked for me. It just uses the default fallback in application/views/scripts/images

'application/xml' => img('fallback-file.png')

The theme should be doing that automatically, so we'll continue looking for the bug.

Fantastic Patrick, that's good enough for me for now!

Many thanks

Upon digging, it isn't really a bug, but just something that might be unexpected. Some themes can be configure to display an image gallery, which will always give the fallback (that's what happens on the admin side). Other themes just display the derivative image, or a fallback for some particular file types.