Download links for non-standard file types

I would like to add .gpx files attached as media to Omeka S items. I add the relevant extension and file type (“text/xml”) in the settings, and I can upload it alright.

The publicly visible page of the item then includes reference to the media and its title, as well as a download link to the file itself. This is all as expected, except for one thing: the text to be clicked on to download the file is the file name used internally by Omeka, i.e. something like this: 4e214a8a6a6f7466095f99357e248588b2553650.gpx

I tried to add a custom thumbnail in the advanced tab of the media, but to no avail: only the filename and not the thumbnail is shown.

Any suggestions on how to get a better outcome, without going the whole route of custom ingesters/renderers?

A generic text that remains the same for all files without an own renderer, e.g. a clickable “download file”, would be alright, as I can give context using title and desription. Perhaps the original source file name could be ok.

For my use case, a thumbnail to be uploaded manually for each such items would also work.

I suppose this is defined in a fallback renderer in core Omeka S, but I’m not finding where exactly this is. Any hint would be warmly welcomed.

More broadly, given how Omeka S renames files, I suspect that using the internal file name for the link is unlikely to be the desired solution, and perhaps a generic expression or the media title would be a better default.

I should add that when embeds are disabled, the file appears as expected on the item page, with the custom thumbnail and link to the media page. But this just shifts the issue somewhere else: when you open the media page, then you still have a link with the “ugly” file name.

If there are not more structural solutions, it should be probably possible to fix it in the theme… before the theme calls for echo $media->render();, I could perhaps add a check for media type with something like $media ->mediaType(), and then build something similar to linkPretty() with direct link to the file directly inside the theme.

I would like to add .zif files to Omeka S. file formats. These are Zoomify files.
Karen Needles
Director
Lincoln Archives Digital Project
www.lincolnarchives.org

Assuming this is just a theme using the render method, you’re getting the “fallback” renderer: it prints a link with the media’s filename as the link text.

There’s a couple things going on here: the decision whether to use the “thumbnail” vs the “fallback” renderer is based on whether the media has thumbnails, but we only check for auto-generated thumbnails, not one added manually.

We probably shouldn’t be using the filename as the link text, too: rather the “displayTitle” which would use the media’s Title value, or the “source” (the original filename, generally) if there is no Title.

1 Like

100% agree. “displayTitle” with fallback on “source” would be a great default for the fallback renderer. Check for manually added thumbnails would also be useful.

The 3.1.0 release addresses this: the “default” rendering for a file we don’t know how to render is now to show a thumbnail. If there’s no generated thumbnail, it will show the “fallback” thumbnail appropriate for the type, or the configured custom thumbnail for the file if one is set.

1 Like

Looks good! Thanks a lot for taking care of this!

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.