Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have posted this on the main forum but had no replies so also trying here
http://drupal.org/node/1087594
I need to get kml files to be associated with a Google earth icon instead of the application-octet-stream.png it is showing now. How can I do that please?
Comment | File | Size | Author |
---|---|---|---|
#5 | application-google-earth.png | 3.55 KB | Patroclas |
Comments
Comment #1
Patroclas CreditAttribution: Patroclas commentedAnyone?
Have I asked a dumb question, not explained enough or nobody knows!?
Anyway - Happy St Patrick's Day!
Comment #2
quicksketchGenerally speaking, I have to say this is a difficult task. It requires a custom module that provides an entire set of icons and implements hook_filefield_icon_sets(). Doing a quick Google reveals some others have documented this already: http://ymbra.com/en/blog/ramon/changing-icon-filefield-fields.
Unfortunately I don't think the Google Maps KML extension/MIME type is known to FileField. If you know the MIME type, I'd be happy to add it as a feature like I did for #1047480: provide icons for rtf (application/rtf) and pps (application/vnd.openxmlformats-officedocument.presentationml.slideshow) files.
Comment #3
quicksketchI went ahead and added the following mime checks:
So once you make a custom icon set, you can create an "application-google-earth.png" file for these file types.
Comment #4
Patroclas CreditAttribution: Patroclas commentedThank you - just what I needed!
Comment #5
Patroclas CreditAttribution: Patroclas commentedUsing the code in the link in #2 to create a new custom module, this has worked perfectly. A kmz/kml icon is attached if anyone needs it.
Comment #7
drupac_shakur CreditAttribution: drupac_shakur commentedSeems the fix linked to in comment #2 of this thread has negative effects on db I/O with > moderate traffic sites as it calls variable_set() in hook_init() and forces the variables cache to update on virtually every request.
This was filling up our MySQL binlog at an alarming rate.