This plugin tries to map known mime types commonly found on the internet to an icon set. There are not many icon sets that have a got coverage of mime types despite looking nicely, yet still coherent, not too exotic so that they can be used with a variety of web designs without too much of a problem.
MimeIconPlugin comes with two complete icon sets, namelyoxygen
, crystal
and papirus
provided in
several sizes.
%MIMEICON{ "screenshot.png" size="48" theme="oxygen" }%
will give you:
if this plugin is installed.
The idea is that you can pretty much throw any file at it and%MIMEICON
will return the right icon for it
reflecting the mimetype of this file. Well, obviously there is a fallback to a neutral icon in case some
file extension is totally unknown.
get
endpoint allows to retrieve a proper icon for a given mime type or file.
Parameter | Description | Default |
---|---|---|
file |
file or file extension for which to retrieve a matching icon | |
size |
size of icon | 48 |
theme |
icon set | $Foswiki::cfg{Plugins}{MimeIconPlugin}{Theme} |
class |
css class(es) to be added to the icon in addition to foswikiIcon , <iconName> and <themeName> |
get
service will create a redirect to the proper icon url in a way that it can be used in an IMG html tag
<img src="%SCRIPTURLPATH{"rest"}%/MimeIconPlugin/get?file=foobar.docx;size=48" />
redirects to
.../pub/System/MimeIconPlugin/oxygen/48x48/application-vnd.oasis.opendocument.text.png
cd /path/to/foswiki perl tools/extension_installer <NameOfExtension> installIf you have any problems, or if the extension isn't available in
configure
, then you can still install manually from the command-line. See https://foswiki.org/Support/ManuallyInstallingExtensions for more help.
18 Nov 2019: | (3.13) default to papirus icon set |
13 Dec 2018: | (3.12) added more mappings for office file types |
26 Nov 2018: | (3.11) docu fixes |
12 Nov 2018: | (3.10) added class parameter |
06 Nov 2018: | (3.00) added papirus icon set |
16 Aug 2018: | (2.01) disabled error message writing to stderr |
30 Aug 2017: | (2.00) added get REST handler |
09 Sep 2016: | (1.31) added vsd to image mapping |
17 Jul 2015: | (1.30) added support for google file formats webp, weba, webm |
22 May 2013: | (1.20) only ship icons covered by a mapping |
16 Dec 2011: | (1.10) fixed mapping in oxygen icon set; fix to make sure the icon mapping is read in properly |
Author | Michael Daum |
Version | 3.13 |
Release | 18 Nov 2019 |
Description | Icon sets for mimetypes |
Repository | https://github.com/foswiki/MimeIconPlugin |
Copyright | © 2010-2019 Michael Daum http://michaeldaumconsulting.com |
License | GPL (Gnu General Public License) |
Home | Foswiki:Extensions/MimeIconPlugin |
Support | Foswiki:Support/MimeIconPlugin |
I | Attachment | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|
png | MimeIconPluginSnap1.png | manage | 18 K | 18 Nov 2019 - 13:57 | ProjectContributor | |
png | MimeIconPluginSnap2.png | manage | 40 K | 18 Nov 2019 - 13:57 | ProjectContributor | |
png | MimeIconPluginSnap3.png | manage | 12 K | 18 Nov 2019 - 13:57 | ProjectContributor |