Icons for sound files

Any advice for incorporating some kind of universal icon for item types that are not images, so that they will have a default thumbnail?

I have a lot of sound files that I will be working with in the near future and would like my theme to display a uniform icon/thumb for each sound file.

Are there any plans to add such a feature to the core of Omeka any time soon or will this continue to be specific to each theme?

Hi Erin,

I'm fairly sure that I understand your question but I need a clarification first. You voiced an interest in "incorporating some kind of universal icon for item types that are not images, so that they will have a default thumbnail" -- however, no item types have thumbnails.

Is it correct to assume that you meant to say 'file type'?

Dealing with item types would be a very different solution.

Thanks.

Dave

Yes, I meant file types. (Although, if it is possible, an item type solution would also work.)

Basically, I would like audio items (WAV and MP3 files) to display a custom icon that works in the same way as the thumbnail works within the theme, particularly when browsing items.

This may not be exactly what you're looking for, but I used CSS selectors to add pdf icons to pdf files, and something similar should work with sound files.
To get this to work in 0.10, I needed to:

  1. modify application/helpers/Media.php:defaultDisplay to add a title attribute to the file links.
  2. Add some selectors to themes/<theme name>/css/screen.css
    a[title$='.pdf'] {
        display:inline-block;
        padding-left:20px;
        line-height:18px;
        background:transparent url(../icons/file_acrobat.gif) center left no-repeat;
    }
    
    a[title$='.wav'] {
        display:inline-block;
        padding-left:20px;
        line-height:18px;
        background:transparent url(../icons/page_sound.gif) center left no-repeat;
    }
    
    a[title$='.jpg'] {
        display:inline-block;
        padding-left:20px;
        line-height:18px;
        background:transparent url(../icons/page_tree.gif) center left no-repeat;
    }
  3. lastly, some file type icons. I used the mini icon set from famfamfam.com. If you want to use bigger icons, You'll probably have to tweak the CSS a little.

Here's an example of it from our site: http://uwlib5.uwyo.edu/omeka/items/show/45. The icon shows up in front of the file link twords the bottom.

The next version of Omeka will include the ability to associate icons w/ file-types in the theme. The specific ticket that was completed is located here: https://omeka.org/trac/changeset/3547

Basically, whenever you use the display_files function in Omeka, you'll be able to pass an array that includes file mime-types (referring to what file the icon is associated w/), and then include a file that's in the images directory of your theme. That way, you'll easily be able to share themes w/ icons.

I've been able to associate icons with file types, per Dave's post. Very cool feature.

To take it a step further, is there a way for that icon to display as a thumbnail for the item as well?

In specific, I'm trying to make the look of the Browse Items page more uniform by generating thumbnail images for all items, even those that don't have images associated with them (audio and video, for example).

One solution is to add an icon image to the audio/video item, which will then act as the thumbnail. The problem is that I would like to then keep the icon image from displaying under display_files_for_item and item_fullsize, while continuing to allow regular images to display on non-audio/video items.

Any thoughts?

Just getting started and see my exact request in nathndirks post -- from 2 years ago!

I can create a square thumbnail to use for pdfs, websites, audio files, but don't want to have to upload multiple copies of this same image in order to have them used as thumbnails on the Browse Items page.

I assume I'll be able to figure out how to "sniff" the file type or item type and turn off thumbnails on the show item page, but it would be nice to be able to just reference a thumbnail image that's already been uploaded instead of uploading multiple copies of generic images.

barback,

The solution to your two inquiries is available on the main Documentation page under Recipes, Item 2:

"Add default thumbnail links for items without images."